471,851 Members | 1,237 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 1765

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