| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL: commit, savepoint and roll
Peter Laursen wrote:
>
> Hello All
> I need to do two inserts stmts in a PL/SQL procedure. Either both must fail
> or both may commit.
>
> Could someone give a simple codeexample?
>
> How do I deal with autocommit? Must I save the original autocommit value,
> set it to false and then reset it to its original value?
>
> Thanks
> Peter
The really nice thing about PL/SQL is that (assuming you do not override with your own commits/rollbacks) it is its own logical unit of work...
so for example:
proc XXX is
begin
insert.. update... delete...
etc etc
end;
if any one of these sql's fail, then all will be rolled back...
Cheers
--
"Some days you're the pigeon, and some days you're the statue." Received on Mon Jul 26 1999 - 07:58:38 CDT
![]() |
![]() |