469,582 Members | 2,275 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Rollback with atomic block

Hi All

I wrote SP with number of delete commands in an atomic block.And there is a possibility of deleting records from parent table before child table so I wrote a handler to handle the exception.in that handler I am using the ROLLBACK to rollback all the records which were deleted if any exception occurs.

THE PROBLEM IS: It is working fine, if the deleting records size is small.but if i tried to delete thousands of records(lorge size) it is giving the following error


SQL0774N The statement cannot be executed within an ATOMIC compound SQL statement.



Explanation:
A COMMIT or ROLLBACK statement was encountered within the context of an ATOMIC compound SQL statement. These statements are not allowed in this context.
User Response:
Remove the COMMIT or ROLLBACK statement or change the context so that it is not an ATOMIC compound statement
Mar 26 '07 #1
0 1642

Post your reply

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

Similar topics

2 posts views Thread by mahajan.sanjeev | last post: by
42 posts views Thread by Shayan | last post: by
1 post views Thread by Sid Gudes | last post: by
reply views Thread by Jim Heavey | last post: by
7 posts views Thread by Joe HM | last post: by
2 posts views Thread by Ian Boyd | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.