If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > CLI0115E Invalid cursor state. SQLSTATE=24000

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-29-10, 01:18
sriramkanala sriramkanala is offline
Registered User
 
Join Date: Nov 2005
Posts: 7
CLI0115E Invalid cursor state. SQLSTATE=24000

I have a simple stored procedure that reads from a table and inserts into another table. Stored procedure is given below

CREATE PROCEDURE TEST_PROC
()
SPECIFIC TEST_PROC
MODIFIES SQL DATA
NOT DETERMINISTIC
CALLED ON NULL INPUT
COMMIT ON RETURN NO
INHERIT SPECIAL REGISTERS
OLD SAVEPOINT LEVEL
LANGUAGE SQL
P1: BEGIN

FOR i AS SELECT COLUMN1, COLUMN2
FROM TEST_TABLE
DO
INSERT INTO TEST_MSG(MSG) VALUES (i.COLUMN1);
END FOR;


END P1;


When I execute this proc as follows:
CALL TEST_PROC()

I see the following error:
An exception occurred
Message: [IBM][CLI Driver] CLI0115E Invalid cursor state. SQLSTATE=24000
SQL: CALL TEST_PROC()
Method: TDB2DirQuery.Next


I am unable to figure out what's causing invalid cursor state.
Can anyone point out the mistake that I'm doing in this proc?
I tried by definining a cursor and looping through it, but was getting the same error.
Thanks in advance.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On