Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: error handling in PL/SQL
Daud wrote:
> 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
CREATE OR REPLACE PROCEDURE AAA IS
i PLS_INTEGER;
BEGIN
BEGIN
SELECT COUNT(*) INTO i FROM all_tables_at_someplaceelse; EXCEPTION WHEN OTHERS THEN RAISE LinkDown;
EXCEPTION
WHEN LinkDown THEN
... exit gracefully
END;
Daniel Morgan
Received on Wed Aug 14 2002 - 12:21:28 CDT