Home » SQL & PL/SQL » SQL & PL/SQL » Invalid Cursor (Oracle 9i)
Invalid Cursor [message #342069] Thu, 21 August 2008 04:48 Go to next message
subbu_tce
Messages: 98
Registered: July 2007
Location: pune
Member
Dear All,
When am executing the below block am getting Inavlid cursor.
Kindly suggests me .How to resolve it?

DECLARE
CURSOR c_cur IS ( SELECT ts_id,map_seq FROM ASSIGN_IMD a WHERE a.STATUS='A' MINUS SELECT ts_id,map_seq
FROM PROTGT_SEASONALITY
);
-- c_rec c_cur%ROWTYPE;
TYPE numType IS RECORD (v_ts_id NUMBER, v_map_seq NUMBER);
c_rec numType;
BEGIN
LOOP
FETCH c_cur INTO c_rec;
EXIT WHEN c_cur%NOTFOUND;
FOR Rec IN (SELECT * FROM ASSIGN_IMD WHERE TS_ID=c_rec.v_ts_id AND map_seq =c_rec.v_map_seq)
LOOP
DBMS_OUTPUT.PUT_LINE(Rec.EMP_CODE);
END LOOP;
END LOOP;
END;
Re: Invalid Cursor [message #342071 is a reply to message #342069] Thu, 21 August 2008 04:57 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You need to open the cursor c_cur before you can fetch into it.
Re: Invalid Cursor [message #342072 is a reply to message #342069] Thu, 21 August 2008 04:58 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter).
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Copy and paste your session.

Regards
Michel
Re: Invalid Cursor [message #342079 is a reply to message #342072] Thu, 21 August 2008 05:12 Go to previous message
subbu_tce
Messages: 98
Registered: July 2007
Location: pune
Member
Oh sorry.I forgot to open the cursor.
Thank you.
Previous Topic: Oracle 10 G
Next Topic: API Error
Goto Forum:
  


Current Time: Sun Dec 04 08:46:59 CST 2016

Total time taken to generate the page: 0.08203 seconds