Right what i've got is a situation where I need to pass the table name to a procedure and open the cursor variable in the procedure with the variablr table name ptable when i try to compile this i get the error
Errors for PACKAGE BODY CURSOR_WEAK:
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/3 PL/SQL: Statement ignored
5/21 PLS-00201: identifier 'MY_CUR' must be declared
10/19 PL/SQL: SQL Statement ignored
10/33 PLS-00201: identifier 'PTABLE' must be declared
can I not use variables that I have declared in the spec to use in the select statement.
create or replace package cursor_weak as
type my_cursor is REF CURSOR;
procedure open_cursor_data (my_cur in out my_cursor, ptable VARCHAR2);
procedure get_table_data;
end;
/
create or replace package body cursor_weak as
procedure get_table_data is
begin
open_cursor_data (my_cur, 'data1');
end;
procedure open_cursor_data (my_cur in out my_cursor, ptable VARCHAR2) is
begin
open my_cur FOR SELECT * FROM ptable;
end;
end;
/
Errors for PACKAGE BODY CURSOR_WEAK:
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/3 PL/SQL: Statement ignored
5/21 PLS-00201: identifier 'MY_CUR' must be declared
10/19 PL/SQL: SQL Statement ignored
10/33 PLS-00201: identifier 'PTABLE' must be declared
can I not use variables that I have declared in the spec to use in the select statement.
create or replace package cursor_weak as
type my_cursor is REF CURSOR;
procedure open_cursor_data (my_cur in out my_cursor, ptable VARCHAR2);
procedure get_table_data;
end;
/
create or replace package body cursor_weak as
procedure get_table_data is
begin
open_cursor_data (my_cur, 'data1');
end;
procedure open_cursor_data (my_cur in out my_cursor, ptable VARCHAR2) is
begin
open my_cur FOR SELECT * FROM ptable;
end;
end;
/