469,272 Members | 1,467 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,272 developers. It's quick & easy.

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)...

Ex.
Expand|Select|Wrap|Line Numbers
  1. Insert into SchemaName.Table1 (field1, field2)
  2. Values ('test1', 'test12')
  3.  
  4. Insert into SchemaName.Table2 (field1, field2)
  5. Values ('test22', 'test222') 
  6.  
  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 4575
frozenmist
179 Expert 100+
Hi,
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.

Cheers
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.