Please, Help with Dynamic sql with BULK INTO [message #20515] |
Fri, 31 May 2002 04:21 |
Valcindor
Messages: 2 Registered: May 2002
|
Junior Member |
|
|
Could you please help me with the following.
I have this procedure that does not work.
procedure test
IS
TYPE cursor_toto IS REF CURSOR;
TYPE NameList IS TABLE OF td_toto.toto_col%TYPE;
names NameList;
c1 cursor_toto;
v_select varchar2(2000);
BEGIN
v_select :='select distinct toto_col from td_toto';
OPEN c1 FOR v_select;
FETCH c1 BULK COLLECT INTO names;
IF c1%NOTFOUND THEN
...some code
END IF;
.. some other code
CLOSE c1;
END TEST;
I get the following error : ORA-01001: invalid cursor !!
But if I replace
OPEN c1 FOR v_select;
by
OPEN c1 FOR 'select distinct toto_col from td_toto';
I get the result I expect.
|
|
|
|