user2783755
user2783755

Reputation: 588

PLSQL rollback changes made by procedure A from procedure B

I have pls/ql procedure procedure_test(), this procedure changes some data in tables, and this procedure doesn’t have any commits or rollbacks.

So I call this procedure from another one - procedure_test2() after calling of procedure_test() from procedure_test2() all changes in procedure_test() are committed. So, how can I rollback changes made by procedure_test() from procedure_test2()?

Thanks.

Upvotes: 0

Views: 142

Answers (1)

PKey
PKey

Reputation: 3841

You can use savepoint e.g. in procedure_test2() the code would be like

...
savepoint bforetest;
procedure_test(); 
rollback to savepoint bforetest; //this actually cancels whatever _test did.
...

Upvotes: 2

Related Questions