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