Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

problem with multiple cursors

$
0
0
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

Viewing all articles
Browse latest Browse all 13329

Trending Articles