Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Add data to col only which is newly added through batch

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
guptae

Moderator


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

PostPosted: Wed Oct 11, 2006 11:27 am    Post subject: Add data to col only which is newly added through batch
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    Post subject: Re: Add data to col only which is newly added through batch
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: 1187
Location: Bangalore,India

PostPosted: Wed Oct 11, 2006 6:30 pm    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Thu Oct 12, 2006 10:51 am    Post subject: Re: Add data to col only which is newly added through batch
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: 1187
Location: Bangalore,India

PostPosted: Thu Oct 12, 2006 11:10 am    Post subject:
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    Post subject: Re: Add data to col only which is newly added through batch
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: 1452
Location: Chicago, IL

PostPosted: Fri Oct 13, 2006 12:12 pm    Post subject: Re: Add data to col only which is newly added through batch
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: 1187
Location: Bangalore,India

PostPosted: Fri Oct 13, 2006 12:16 pm    Post subject:
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    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Fri Oct 13, 2006 7:17 pm    Post subject: Re: Add data to col only which is newly added through batch
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: 1187
Location: Bangalore,India

PostPosted: Fri Oct 13, 2006 7:22 pm    Post subject:
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    Post subject: Re: Add data to col only which is newly added through batch
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Batch job tunning sgandhla Testing & Performance analysis 0 Fri Mar 24, 2017 9:41 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us