| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: What happens after an error in an PL/SQL proc?
Oracle will *NOT* return. If you want to accomplish that you'll need to have
for ...
begin
select ...
update
exception
end;
end loop;
exception
end;
If you don't reraise the exception in the inner exception section, the code will continue processing.
Hth,
Sybrand Bakker, Oracle DBA
<mitch23_at_hotmail.com> wrote in message news:8uuqbg$o96$1_at_nnrp1.deja.com...
> I have a return parm in an Oracle 8.0 stored procedure that indicates
> whether any errors occurred in the proc. I have (very) simple
> exception handler that returns a 1 in the return parm if the proc
> errors and then terminates execution. I had no compilation errors but
> I wanted to make sure that the following code will have the desired
> effect. If an error occurs, will Oracle terminate execution of the
> proc or will it return to the FOR...LOOP and continue processing?
>
>
> Thanks much!
> =====================================================
> CREATE PROCEDURE UPDATE_LOAN(SUCCESS OUT NUMBER) IS
>
>
> CURSOR LOANS IS
>
> SELECT A.CLIENT, A.LOAN
> FROM ALODETAIL A, ALOLOAN C WHERE A.LOAN=B.LOAN
>
> tmpBalance NUMBER(30,3) := 0.00;
>
>
> BEGIN
>
> SUCCESS := 2;
>
> FOR rs IN loans loop
>
> SELECT SUM(A.AMOUNT) INTO tmpBalance FROM ALODETAIL A WHERE
> LOAN=rs.LOAN;
>
> UPDATE ALOLOAN SET AMOUNT_6=(tmpBalance) WHERE LOAN=rs.LOAN;
>
> COMMIT;
>
> END LOOP;
>
> EXCEPTION
> WHEN OTHERS THEN
> SUCCESS := -1;
> END;
>
>
>
>
>
>
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Nov 15 2000 - 14:36:31 CST
![]() |
![]() |