Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2005
    Posts
    7

    Unanswered: CLI0115E Invalid cursor state.

    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 defining a cursor, and looping through a cursor also, but was getting same error.
    Thanks in advance.
    Last edited by sriramkanala; 04-02-10 at 05:49.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •