Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: error handling in PL/SQL
Hi All
I have tried the things suggested above but it did not work. In the exception handling part, I even have only:
....
exception
when others then dbms_output.put_line('blah....');end;
but the code in the exception handler never got executed. I have tried exception handling many times with other oracle errors and have no problem. It is only this that I am having problem with. I believe it is because oracle is trying to resolve the remote objects first before executing the codes but since it can't do that...it raises an error.
Has anyone tried something similar in the past?
rgds
Daud
mark.powell_at_eds.com (Mark D Powell) wrote in message news:<178d2795.0208141139.43b8bced_at_posting.google.com>...
> daud11_at_hotmail.com (Daud) wrote in message news:<f0bf3cc3.0208140633.2b055ed7_at_posting.google.com>...
> > I have a procedure that looks something like below.
> >
> > create or replace procedure AAA ....
> > cursor mycursor is select ... from mytable_at_remotedb;
> > ....
> > begin
> >
> > open mycursor;
> > ...
> >
> >
> > end;
> >
> > The problem I am having is that sometimes the remote db is not up and
> > I would like to be able to handle the error that would be raised
> > gracefully. How do I do that? I have tried to put EXCEPTION in the
> > 'begin....end' block but that did not worked. Any way to solve this?
> >
> > rgds
> > Daud
>
> I would think that coding an exception handler would be the way to do
> this providing the handler trapped the specific error message returned
> by Oracle. How did you go about coding the exception block? And did
> you use a pragma statement to tie the expected Oracle error to a
> program error? Example:
> pragma exception_init(constraint_viol,-02291
>
> I haven't actually tried to capture the error returned on a remote
> query when the remote db is unavailable, but the above has worked for
> every other Oracle error I have tried so I would think it would work
> here.
>
> HTH -- Mark D Powell --
Received on Thu Aug 15 2002 - 00:52:12 CDT
![]() |
![]() |