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

Home -> Community -> Usenet -> c.d.o.server -> Re: Exception raised in a loop

Re: Exception raised in a loop

From: sybrandb <sybrandb_at_gmail.com>
Date: 18 Apr 2007 06:52:44 -0700
Message-ID: <1176904364.406318.145520@n76g2000hsh.googlegroups.com>


On Apr 18, 1:44 pm, valigula <valig..._at_gmail.com> wrote:
> Hi , Is it possible to raised a exception inside a loop in oracle 9i??
>
> PROCEDURE somprocedure (resultado OUT generic_cursor)
> IS
> tmp INTEGER;
> tmp_2 INTEGER;
> stringsql VARCHAR (3000);
> CURSOR movimientosprimero
> IS
> SELECT DISTINCT *
> FROM sometable
> WHERE tipo_mov <> 'B';
> BEGIN
>
> FOR regfichero IN movimientosprimero
> LOOP
> .................
> .................
> COMMIT;
>
> exception
> when others then
> return;
>
> END LOOP;
You would need to
LOOP
begin
...
...
exception ...
end;
end loop;

COMMITTing inside a loop is one of the Seven Main Sins in Oracle.

--
Sybrand Bakker
Senior Oracle DBA
Received on Wed Apr 18 2007 - 08:52:44 CDT

Original text of this message

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