Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2014
    Posts
    294

    Unanswered: problem with multiple cursors

    Hi,

    I am getting some issue on the below multiple cursor

    CREATE PROCEDURE p1()
    P1: BEGIN

    DECLARE --
    --
    --
    --
    DECLARE C1 CURSOR WITH RETURN for SELECT * FROM DUMMY1;

    DECLARE C2 CURSOR WITH RETURN for STN1;

    --
    --
    OPEN C1;
    FETCH FROM C1 INTO ....
    WHILE( )
    DO
    --
    --
    --
    OPEN C2;
    FETCH FROM C2 INTO ...
    WHILE( )
    DO
    --
    --

    FETCH FROM C2 INTO ...
    ---
    --

    END WHILE;

    CALL PROC2();

    FETCH FROM C1 INTO...

    END WHILE;

    END P1


    Error:

    My problem is After executing the second proc (proc1) it has to continue to the first procedure & it has to work with the second row from the first cursor. But I am unable to work with the second row of the first cursor. according to this code I am able to update only the first row of the first cursor. In order to work with the next row of first cursor , what should I need to change .

    Thanks

  2. #2
    Join Date
    Jul 2014
    Posts
    294
    found solution for this need to close the inner cursor .

Tags for this Thread

Posting Permissions

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