Discussion Locked

Commit/Rollback.....

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm trying to add logic to an existing process...
Here it is... Bear with me...
The process is looping and for each loop, it performs a commit or a rollback.
The new logic needs to insert some new data

5 replies

by john.payne

Assuming the commit or rollback is performed based on the success or failure of the existing DML statments inside the loop, add your new logic to the block where the commit would have been performed and move your commit/rollback logic inside this same block, after testing for success/failure of your insert statements.
i.e.
if success then
commit
else
rollback
endif

would become...
if success then
insert statment

if success then
commit else
rollback
endif
endif

Hope this helps.

by ruvic

Some database like oracle has a special feature called "Savepoint" wherein you can selectively commit/rollback specific part of your code.

Please check with your database.

This discussion is closed to new replies.