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
 

 

Batch query to execute insert and update statements

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

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Mon Aug 04, 2008 6:31 pm    Post subject: Batch query to execute insert and update statements
Reply with quote

I am looking for a IBM DB2 supplied batch program that can execute insert and update statements. This program should not commit untill all the sql statements given in the Input card gets executed successfully. Suppose if my card has

Code:
INSERT INTO TABLE1 ...;
UPDATE TABLE ...;


if INSERT executes successfully and UPDATE fails then the INSERT should not be committed. Is there any utility program that can accomplish this?
Back to top
View user's profile Send private message

Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Aug 04, 2008 7:17 pm    Post subject:
Reply with quote

Won't a "COMMIT ;" statement after the UPDATE statement do it?
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Tue Aug 05, 2008 1:12 am    Post subject: Reply to: Batch query to execute insert and update statement
Reply with quote

I think you can try DSNTEP2 or DSNTEP4. I'm not sure about the COMMIT.

I never tried with more than one query as an input to this program. If you try then pls do let us know. Thx
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Tue Aug 05, 2008 1:54 am    Post subject:
Reply with quote

I tried DSNTEP2 and it commits after each statement. I looked into the manual about DSNTEP4 and it is said that it is similar to DSNTEP4.
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Tue Aug 05, 2008 4:02 pm    Post subject:
Reply with quote

ok. Thanks for the info.

Then you may have to code your own program to do the LUW.
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 Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm
No new posts Batch job tuning sgandhla Testing & Performance analysis 5 Fri Mar 24, 2017 9:41 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm


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