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!

ORA-01001: invalid cursor

571956Aug 6 2008 — edited Aug 6 2008
Here's my test code, notice I am limiting my Nested Table Collection to just one record for test purposes. This is my first attempt at using it, so I may be wrong.

But this post is regarding an invalid cursor error I am getting with this code. I am getting the error at the bolded line:

CREATE OR REPLACE TYPE refresh_test_t IS TABLE OF VARCHAR2(100) ;

DECLARE
refresh_test refresh_test_t := refresh_test_t() ;
TYPE CV_TYPE IS REF CURSOR ;
c_id CV_TYPE ;
v_loop NUMBER(10) ;
v_id NUMBER(10) ;

BEGIN
OPEN c_id FOR
'SELECT id
FROM test.loading_dock
WHERE rownum = 1' ;
LOOP
FETCH c_id INTO v_id ;
EXIT WHEN c_id%NOTFOUND ;

refresh_file.EXTEND ;
SELECT id
INTO refresh_file(1)
FROM test.loading_dock
WHERE id = v_id ;

CLOSE c_id ;

DBMS_OUTPUT.PUT_LINE(refresh_file(1)) ;
END LOOP ;
END ;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 3 2008
Added on Aug 6 2008
2 comments
832 views