This question has suggested answer(s)

Bind Variable "cursorMemoria" is NOT DECLARED

Follow / 9 Jul 2018 at 5:05am

hello,

I have the next example: 

create or replace procedure listaEmpleados(cursorMemoria OUT SYS_REFCURSOR)
as
BEGIN
open CURSORMEMORIA for select * from HR.EMPLOYEES;
DBMS_OUTPUT.ENABLE(1000000);
END;

set AUTOPRINT on;

VARIABLE cursorMemoria SYS_REFCURSOR;
EXECUTE listaEmpleados(:cursorMemoria);

But I have the Bind Variable "cursorMemoria" is NOT DECLARED.   Please could you help me.  Thank you.

Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |

VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
BINARY_FLOAT | BINARY_DOUBLE ] ]

Bind Variable "cursorMemoria" is NOT DECLARED
anonymous block completed

Replies

All Replies
  • Suggested Answer
    Follow / 10 Jul 2018 at 2:00pm

    Try this. This is working

    create or replace procedure listaEmpleados(cursorMemoria OUT SYS_REFCURSOR)
    as
    BEGIN
    open CURSORMEMORIA for select * from EMPLOYEES;
    DBMS_OUTPUT.ENABLE(1000000);
    END;

    set AUTOPRINT on;

    set echo on;

    DECLARE
       cursorMemoria SYS_REFCURSOR;
    BEGIN   
      listaEmpleados(cursorMemoria);
    END;