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

Updating Db2 tables in succession


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
deeptik

New User


Joined: 21 Mar 2006
Posts: 8

PostPosted: Fri Jul 10, 2009 10:30 am
Reply with quote

Hi,

There is a table T1. For each row of T1, I need to update tables T2, T3 and T4 in succession i.e if T2 update is successful, then update T3 and if T3 successful then T4 and so on. What is the shortest way to implement this logic in cobol db2 program.

thanks.
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Fri Jul 10, 2009 10:40 am
Reply with quote

Hi deeptik,
I dont know it is the correct answer.sometimes i saw that if i insert a row in to one table the corresponding row will insert in to its child table automatically.I think if you check in the referential integrity topic .May be you will get something.
Excuse me if i'm wrong.
Back to top
View user's profile Send private message
deeptik

New User


Joined: 21 Mar 2006
Posts: 8

PostPosted: Fri Jul 10, 2009 11:56 am
Reply with quote

Ok, but here the requirement is to update other tables and not insert..
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Fri Jul 10, 2009 12:45 pm
Reply with quote

Hi deeptik,
Just update the next(through basic perform) if the sqlcode is 0.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Need to fetch data from so many DB2 t... DB2 9
No new posts Updating a 1 byte thats in occurs mul... DFSORT/ICETOOL 6
No new posts How to: PK does not exist in several ... DB2 6
No new posts Discrepancy b/w SYSIBM tables and BMC... DB2 0
No new posts Updating endevor JCLs CA Products 5
Search our Forums:

Back to Top