471,893 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,893 software developers and data experts.

Begin Tran??

Hi i'm new to DB2...

i'm writing two 'insert' statements, this should work as a single transaction...
is there any command in DB2 to start the transaction (like Begin Tran)...

Expand|Select|Wrap|Line Numbers
  1. Insert into SchemaName.Table1 (field1, field2)
  2. Values ('test1', 'test12')
  4. Insert into SchemaName.Table2 (field1, field2)
  5. Values ('test22', 'test222') 
  7. Commit;
will it work (even if AutoCommit is ON)?? or any change needs to be done?

thanks in Adv.
May 25 '07 #1
1 4794
179 Expert 100+
Dont set auto commit to ON. Use Commit; before and after the two insert statements. That way, only those two statements come under one transaction.

May 26 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by William Orova | last post: by
3 posts views Thread by sajithamol | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.