Is it possible to use commit or rollback in exception section.

Showing Answers 1 - 1 of 1 Answers

archie123

  • Aug 28th, 2007
 

Yes you can use commit or rollback in exception block;

select * from test123;
A
----------
51

Declare
s varchar2(2);
Begin
update test123 set a = a+10;
select a into s from test123 where a=20;
exception
when others then
rollback;
dbms_output.put_line('test'|| s);

End;
SQL> /
test

PL/SQL procedure successfully completed.

SQL> select * from test123;

A
----------
51

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions