In the following code,I open the dynamic cursor, but when my function is reiterating through this more than once, so I get a "cursor already open" error.
Can I close it like the last statement??
How do you close a Dynamic cursor??
Thanks alot,
---------------------------------------------------------
DECLARE cur_cursor DYNAMIC CURSOR FOR SQLSA;
//Declare Returned an Error
If SQLCA.SQLCode=-1 THEN GOTO SQLErr_Current
PREPARE SQLSA FROM :sg_Sql ;
//Prepare Returned an Error
If SQLCA.SQLCode=-1 THEN GOTO SQLErr_Current OPEN DYNAMIC cur_cursor;
//Open Cursor Returned an Error
If SQLCA.SQLCode=-1 THEN GOTO SQLErr_Current
FETCH cur_cursor INTO :in_CableTemp;
//Fetch Returned an Error
If SQLCA.SQLCode=-1 THEN GOTO SQLErr_Current
//I'm trying to close it here
CLOSE DYNAMIC cur_cursor;
Can I close it like the last statement??
How do you close a Dynamic cursor??
Thanks alot,
---------------------------------------------------------
DECLARE cur_cursor DYNAMIC CURSOR FOR SQLSA;
//Declare Returned an Error
If SQLCA.SQLCode=-1 THEN GOTO SQLErr_Current
PREPARE SQLSA FROM :sg_Sql ;
//Prepare Returned an Error
If SQLCA.SQLCode=-1 THEN GOTO SQLErr_Current OPEN DYNAMIC cur_cursor;
//Open Cursor Returned an Error
If SQLCA.SQLCode=-1 THEN GOTO SQLErr_Current
FETCH cur_cursor INTO :in_CableTemp;
//Fetch Returned an Error
If SQLCA.SQLCode=-1 THEN GOTO SQLErr_Current
//I'm trying to close it here
CLOSE DYNAMIC cur_cursor;