Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLS-00103: Encountered the symbol "SYS_REFCURSOR" when expecting one of the following:

3149976Jan 13 2016 — edited Jan 13 2016

Hi Geeks,

I am trying to execute the Procedure from SQL Developer, but these errors are coming. What I may be doing wrong here..

Procedure works fine when i run from compile/Debug mode. But I need to put in C# code later.

SET serveroutput on;

DECLARE

     OutParam1 OUT SYS_REFCURSOR;

     OutParam2 OUT Varchar;

BEGIN

    /* Call procedure within package */

    SPAT_QUERY.SP_VALIDATERULES(9, 'BIS2015001',OutParam1, OutParam2);

    /* Display OUT parameters */

    dbms_output.put_line('OutParam1: ' || OutParam2);

END;

-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Error report -

ORA-06550: line 3, column 20:

PLS-00103: Encountered the symbol "SYS_REFCURSOR" when expecting one of the following:

   := . ( @ % ; not null range default character

06550. 00000 -  "line %s, column %s:\n%s"

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

--Procedure Below :

create or replace PACKAGE BODY SPAT_QUERY

AS

  /* Declare global variable to hold Validation Result. */

  valResult VARCHAR(10);

PROCEDURE SP_VALIDATERULES (

  IN_RQST_NUM IN NUMBER,

  IN_CASEID IN VARCHAR, 

  OUT_REFCURSOR OUT SYS_REFCURSOR, 

  OUT_VAL_RSLT OUT VARCHAR

)

AS

p_rc sys_refcursor;

  i   NUMBER := 0;

  /*Query Logic - Looping through RULES Table based on Request NUM */

  BEGIN

       FOR  rec IN (SELECT * FROM T_RULES where RQST_NUM = IN_RQST_NUM)

       LOOP

            i := i + 1;         

           SP_GETSECTS(IN_CASEID,rec.LYR_TX,rec.TRGT_TX,rec.EXCPTD_RSLT_CD,p_rc); 

           OUT_VAL_RSLT := valResult;        

       END LOOP;    

   END SP_VALIDATERULES;

Thanks,

Ken

This post has been answered by Nimish Garg on Jan 13 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 10 2016
Added on Jan 13 2016
2 comments
1,295 views