dbTalk Databases Forums  

Exception in ProcC

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss Exception in ProcC in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert Trawinski
 
Posts: n/a

Default Exception in ProcC - 05-26-2004 , 12:06 PM






Hi everybody,

It stupid question. How can I handle exception thrown from database
procedures (packages) in ProcC code.
Below is part of some package implementation.



================================================== =

procedure err_srv(err_nr number, err_txt varchar2) is
begin
raise_application_error( C_USER_EXCP + err_nr, err_txt );
end err_srv;

procedure procName1(
p_curBM out BMCursorType
)
is
ID constant varchar(32) := 'procName: ';
begin
open p_curBM for
select b.field1,
b.field2
from BM b
where b.field3 = 'N'
order by 1;

exception
when others then
err_srv(C_PROC_ERR, ID||'others: '||sqlcode||'/'||sqlerrm);
end procName2;


procedure procName2 (........)
begin

begin
select.....;

exception
when no_data_found then
err_srv(-3, 'text' );
end;

exception
when others then
raise;
end procName2;

================================================== =



I need catch exception thrown from such package. I'm completely newbie.

Thanks in advance,

Robert


Reply With Quote
  #2  
Old   
Erik Ykema
 
Posts: n/a

Default Re: Exception in ProcC - 06-11-2004 , 03:56 PM






"Robert Trawinski" <robert.trawinski (AT) softax (DOT) com.pl> wrote

Quote:
Hi everybody,

It stupid question. How can I handle exception thrown from database
procedures (packages) in ProcC code.
Below is part of some package implementation.
[snip]
I need catch exception thrown from such package. I'm completely newbie.
Thanks in advance,
Robert
Try to look it up in the manual. Oracle Corp.'s documentation is usually
quite good, though a bit terse sometimes. URLs of interest are:
http://otn.oracle.com
http://tahiti.oracle.com
http://metalink.oracle.com
http://groups.google.com/groups?hl=e...atabase.oracle
http://groups.google.com/groups?hl=e...tabases.oracle
Good luck,
Erik Ykema




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.