IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Add data to col only which is newly added through batch


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Oct 11, 2006 11:27 am
Reply with quote

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
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Wed Oct 11, 2006 5:32 pm
Reply with quote

Hi Ekta,

Whether you want to Insert static value to all rows or different values depending on the condition?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Oct 11, 2006 6:30 pm
Reply with quote

Hi there ,

i want to insert different value
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Thu Oct 12, 2006 10:51 am
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Oct 12, 2006 11:10 am
Reply with quote

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
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Thu Oct 12, 2006 4:02 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Oct 13, 2006 12:12 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Fri Oct 13, 2006 12:16 pm
Reply with quote

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
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Fri Oct 13, 2006 1:39 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Oct 13, 2006 7:17 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Fri Oct 13, 2006 7:22 pm
Reply with quote

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
View user's profile Send private message
vijay_bn79

New User


Joined: 20 Nov 2006
Posts: 48
Location: Hyderabad

PostPosted: Tue Nov 21, 2006 10:20 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Excuting store procedure via JCL batch JCL & VSAM 1
No new posts db2 vs static data COBOL Programming 1
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts batch SFTP job using AOPBATCH unable ... All Other Mainframe Topics 7
Search our Forums:

Back to Top