Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: a PL/SQL question - how to catch errors without going into ex

RE: a PL/SQL question - how to catch errors without going into ex

From: Brian McGraw <brian.mcgraw_at_infinity-insurance.com>
Date: Thu, 04 Apr 2002 11:36:42 -0800
Message-ID: <F001.0043BCC8.20020404113642@fatcity.com>


Have you considered just adding another exception handler:

i := 1;
while i < 10 loop
  begin
    select the_name from the_table into myvar where the_id = i ;   exception
    when others then
      null; -> or whatever you want to do;   end;
end loop;

The net effect is the same.

HTH - Brian

-----Original Message-----
Bronfin
Sent: Thursday, April 04, 2002 12:49 PM
To: Multiple recipients of list ORACLE-L ex

oooops , i meant

	i := 1;
	while i < 10 loop
	  select the_name from the_table into myvar where the_id = i ;
end loop;

DBAndre

> -----Original Message-----
> From: Andrey Bronfin
> Sent: Thu, April 04, 2002 9:50 PM
> To: oracledba_at_lazydba.com (E-mail); ORACLE-L_at_fatcity.com (E-mail);
> oralist_at_lists (E-mail)
> Subject: a PL/SQL question - how to catch errors without going
into
> exceptions block
>
> Dear gurus !
> I'm wondering whtether i can catch an SQL error (from inside a PL/SQL
> proc) without jumping to the EXCEPTION block
> OR
> is there a way to jump back to the body of the proc from the EXCEPTION
> block (i know that GOTO can not do it).
>
> For example , assume i have users with IDs 1,2,5,6 in my table and i
want
> to do some loop like this
>
> i := 1;
> while i < 10 loop
> select the_name from the_table into myvar where the_id = 1;
> end loop;
> .....
>
> I will be thrown to the EXCEPTION block as soon as i becomes 3.
> And i can never go back to the loop from the EXCEPTION block , in
order to
> continue looping ;-(
> So , can i just tell PL/SQL something like "never mind if U fail (i.e.
an
> exception is thrown) , just go to the next iteration ...
>
> I'm wondering if there is something similar to PERL's
> next if .....
>
> Thanks a lot
> Andre
>
>
>
>
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Andrey Bronfin
  INET: andreyb_at_elrontelesoft.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Brian McGraw
  INET: brian.mcgraw_at_infinity-insurance.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Apr 04 2002 - 13:36:42 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US