View previous topic :: View next topic
|
Author |
Message |
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi,
Would u please tell me is there any utility by which we can data to only that coloum which is newly added?
Suppose we have a db2 table that contain 3 coloum now we added another coloum lets say field-d &now we have to insert values for only field-d through batch |
|
Back to top |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
Hi Ekta,
Whether you want to Insert static value to all rows or different values depending on the condition? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi there ,
i want to insert different value |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
added another column to existing table ???
Something like this... and now you want to populate SAL based on GRADE or DEPT... am I getting it correctly ?
Code: |
EMP# DEPT GRADE SAL
010 IT A
011 HR B
012 IT C
014 SEC A |
|
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi there,
Not exactly like that suppose we had a table taht contain only emp#, dept, grade. Now we have alter the table & add 1 more coloum sal.
now i want add data in sal coloum for every record through batch . i dont want to write insert query nor unload the table in to file edit the file and load it.
now I want to insert 1000,2000,3000,4000 for all the four record i have in my table through batch
I hope I make myself clear enough. |
|
Back to top |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
Hi,
Usually, Data will be migrated using Insert/update query or unload-edit-load method.
Lets see if any one come up with a UTILITY..... |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Hi Ekta,
Quote: |
now I want to insert 1000,2000,3000,4000 for all the four record i have in my table through batch
I hope I make myself clear enough. |
I am sorry, if I am being a little egghead but do you want to say that you just want to put 1000 for first, 2000 for second and so on.
I mean, Do you want to put value of SAL based on any value in earlier columns or just a simple INSERT row wise.
I am not aware about any such utility but you can always put you SQL stmts in a Batch step. Can't you ?
Regards, |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi priyesh,
I just want to add some randome value which is not based on any prev coloum.
I heard that can be done some utility i dont wnat to insert through SQL. |
|
Back to top |
|
|
twissi
Active User
Joined: 01 Aug 2005 Posts: 105 Location: Somerset, NJ
|
|
|
|
guptae wrote: |
I heard that can be done some utility i dont wnat to insert through SQL. |
I would've thought SQL is the only way of communicating with DB2; even if you use some utility to INSERT/UPDATE, SQL would have been used internally!
Priyesh, please comment.
Twissi. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
twissi... My understanding on this is same. Utility is not going to do anything special.
Ekta... I realized later... I was wrong in saying using a batch SQL, as you would not be able to use cursors there.... and looking at your requirement seems you'll need cursors as you want to update row by row. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Priyesh,
Like for loading a db2 table we need not require any sql is there any other utility by which we can add the data for only one coloum. |
|
Back to top |
|
|
vijay_bn79
New User
Joined: 20 Nov 2006 Posts: 48 Location: Hyderabad
|
|
|
|
Hi...,
By using DB2 FILEAID utility you can insert, update and delete the values of the table
command is TSO FA
give table name and the region qualifier
and give the option like edit, browse etc...
then you can edit the table and save
Thanks |
|
Back to top |
|
|
|