Hello,
What I’m missing in the following:
PROCEDURE proc(
p_var1 IN varchar2,
…
p_cur In OUT cur_type)
IS
lnCursor INTEGER;
lnDummy INTEGER;
lvcSql VARCHAR2(2000);
v_where varchar2(1000);
BEGIN
--v_where defined here from p_var1
lnCursor := DBMS_SQL.OPEN_CURSOR;
lvcSql :='OPEN p_cur FOR SELECT col1, col2 '||
'FROM table '|| v_where ;
dbms_output.put_line(lvcSql); --looks fine
DBMS_SQL.PARSE( lnCursor, lvcSql, DBMS_SQL.V7 );
lnDummy := DBMS_SQL.EXECUTE( lnCursor );
DBMS_SQL.CLOSE_CURSOR( lnCursor );
I get here ORA-00900: invalid SQL statement when parsing.
Please help!
What I’m missing in the following:
PROCEDURE proc(
p_var1 IN varchar2,
…
p_cur In OUT cur_type)
IS
lnCursor INTEGER;
lnDummy INTEGER;
lvcSql VARCHAR2(2000);
v_where varchar2(1000);
BEGIN
--v_where defined here from p_var1
lnCursor := DBMS_SQL.OPEN_CURSOR;
lvcSql :='OPEN p_cur FOR SELECT col1, col2 '||
'FROM table '|| v_where ;
dbms_output.put_line(lvcSql); --looks fine
DBMS_SQL.PARSE( lnCursor, lvcSql, DBMS_SQL.V7 );
lnDummy := DBMS_SQL.EXECUTE( lnCursor );
DBMS_SQL.CLOSE_CURSOR( lnCursor );
I get here ORA-00900: invalid SQL statement when parsing.
Please help!