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 -> What happens after an error in an PL/SQL proc?

What happens after an error in an PL/SQL proc?

From: <mitch23_at_hotmail.com>
Date: Wed, 15 Nov 2000 20:06:14 GMT
Message-ID: <8uuqbg$o96$1@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:06:14 CST

Original text of this message

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