prompt
prompt 创建存储过程eoda.p
create or replace procedure eoda.p
as 
begin
    insert into eoda.t values (1);
    insert into eoda.t values (-1);
end;
/

prompt
prompt 插入数据到eoda.t
begin
    delete from eoda.t;
    update eoda.t2 set cnt = 0;
    commit;
end;
/

select * from eoda.t;
select * from eoda.t2;

prompt
prompt 执行存储过程eoda.p
begin
    begin
        p;
    exception
        when others then 
            dbms_output.put_line( 'Error!!!' || sqlerrm );
    end;
end;
/

select * from eoda.t;
select * from eoda.t2;

prompt
prompt 执行存储过程eoda.p,使用savepoint
begin
    begin
        savepoint sp;
        p;
    exception
        when others then
            rollback to sp;
            dbms_output.put_line( 'Error!!!' || sqlerrm );
    end;
end;
/

select * from eoda.t;
select * from eoda.t2;
