CREATE Oracle Procedure CREATE Oracle Procedure oracle oracle

CREATE Oracle Procedure


You cannot explicity OPEN the cursor and also use it in an implicit FOR loop. You much choose either implicit (FOR loop) or explicit(OPEN/FETCH/CLOSE).


If you use a cursor with a FOR/IN/LOOP, you don't need to open it explictly. Just write:

SQL> CREATE OR REPLACE PROCEDURE Update_STUD_Fin ( AIDY_CODE IN VARCHAR2 ) IS  2    CURSOR PublicationC IS  3      SELECT SGidm from SGB  4       WHERE SGCODE_EFF ='201030';  5  BEGIN  8    FOR PublicationR IN PublicationC  9    LOOP 10      DBMS_OUTPUT.PUT_LINE( PublicationR.SGidm ); 11    END LOOP; 12   15  END; 16  /


6512 Error message indicates the line number in PL-SQL code that the error resulted.Are you sure you don't have another message before ?