使用异常处理:create or replace prc_insert(state out varchar)
being
insert into tbl(...)values(...);
commit;
state :=1;
Exception
when 错误 then
rollback;
state := 0;
end;
being
insert into tbl(...)values(...);
commit;
state :=1;
Exception
when 错误 then
rollback;
state := 0;
end;
being
SET TRANSACTION NAME '事务名'
insert into tbl(...)values(...);
update tbl set ... where... ;
commit;
state :=1;
Exception
when 错误 then
rollback;
state := 0;
end;