Create Oracle Cursor

Posted by Mohammad on Stack Overflow See other posts from Stack Overflow or by Mohammad
Published on 2010-12-31T13:10:01Z Indexed on 2010/12/31 13:54 UTC
Read the original article Hit count: 383

Filed under:

Hi,

I create a cursor like this:

SQL> CREATE OR REPLACE PROCEDURE Update_STUD_FinAid ( AIDY_CODE IN VARCHAR2 ) IS
  2    CURSOR PublicationC IS
  3      SELECT SGBSTDN_USER_ID from SGBSTDN
  4       WHERE SGBSTDN_TERM_CODE_EFF ='201030';
  5  BEGIN
  6    close PublicationC;
  7    
  8    OPEN PublicationC;
  9  
 10    FOR PublicationR IN PublicationC
 11    LOOP
 12      DBMS_OUTPUT.PUT_LINE( PublicationR.SGBSTDN_USER_ID );
 13    END LOOP;
 14  
 15    close PublicationC;
 16   
 17  END;
 18  /

Procedure created.

And then when I run the Procedure then I get this error:

ERROR at line 1:
ORA-06512: at line 2

Please advise.

Thanks

© Stack Overflow or respective owner

Related posts about cursor