how can i propgate the error message from a procedure to another procedure

6 views
Skip to first unread message

ahmed eitah

unread,
May 10, 2010, 3:54:48 PM5/10/10
to oracle-...@googlegroups.com, zouz...@yahoo.com
who can i catch an error message from a called procedure in the calling procedure. for example
here is the called procedure

PROCEDURE check_tawreed(raqmtawriedE IN NUMBER,raqmmawrade in number,daleel in number)is
  var_tawreed asnaf_rec;
  var_amr  amr_tawried%rowtype;
  my_exc exception;
  my_ex_2 exception;
  my_ex_3 exception;
 begin
 open curs_amr(raqmtawriede);
 fetch curs_amr into var_amr;
 if curs_amr%notfound then
 raise my_exc;
 end if;
 /* if var_amr.open = 1 then
 raise my_ex_2;
 end if; */
 if var_amr.RAQMMAWRAD <> raqmmawrade then
 raise my_ex_3;
 end if;
  
 close curs_check_tawreed;
 close curs_amr;
 exception
 when my_exc then
 close curs_check_tawreed;
 raise_application_error(-20203,' a1');
  when my_ex_2 then
 close curs_check_tawreed;
 raise_application_error(-20203,'a2'); 
 when my_ex_3 then
 close curs_check_tawreed;
 raise_application_error(-20203,' a3');
 end check_tawreed;

 here is the calling procedure

 PROCEDURE dELtawreed(raqmtawriede in number) is
 var_i number(1);
 var_up shra_tawried%rowtype;
 var_amr amr_tawried%rowtype;
 my_exc exception;
 BEGIN
  if raqmtawreede = var_up.raqmtawried then
 nmawardeen.check_tawreed(raqmtawreede,amiel,0);
 elsif raqmtawreede > var_up.raqmtawried then
 delete from shra_tawried where raqmfatoura = raqmtawriede;
 else
 raise my_exc;
 end if;
 commit;
  exception
 when my_exc then
 close curs_check_tawreed;
 raise_application_error(-20203,' a1');
 end dELtawreed;

 when i execute dELtawreed and a handeled exception occurs in check_tawreed(for example my_ex_2)i get the following message 'error an error had occured taht is not handelled' although there is handeler for the exception in check_tawreed.how can i propgate the error message to dELtawreed.
                                                                                                        thanks in advance
                                                                                                               ahmad




ddf

unread,
May 10, 2010, 4:40:02 PM5/10/10
to Oracle in World
Read here:

http://oratips-ddf.blogspot.com/2008/03/what-was-that-masked-message.html

The last half of the post addresses this issue.


David Fitzjarrell
Reply all
Reply to author
Forward
0 new messages