CREATE OR REPLACE PROCEDURE TestPr(a number)
as
sql_error exception;
begin
/*
SQL-----
*/
if sql%rowcount = 0 then
raise db_error;
end if;
exception
when db_error then
raise_application_error (-20001,'error');
end
as
sql_error exception;
begin
/*
SQL-----
*/
if sql%rowcount = 0 then
raise db_error;
end if;
exception
when db_error then
raise_application_error (-20001,'error');
end
insert into testa(id,name) values(1,'OK');
commit;
p_out:=0;
exception
when others then
rollback;
p_out:=-1;
end;--p_out是输出参数,成功返回0出现错误,回滚,返回-1