|
View previous topic :: View next topic
|
| Author |
Message |
satishboddu
New User
Joined: 02 Aug 2011 Posts: 17 Location: India
|
|
|
|
Hi,
I am fetching from a cursor using Dynamic SQL,
EXEC SQL
DECLARE DT2 CURSOR FOR SEL2
END-EXEC.
EXEC SQL
PREPARE SEL2 FROM :WS-SQL-AREA-G
END-EXEC.
EXEC SQL
DESCRIBE SEL2 INTO :SQLDA2
END-EXEC.
EXEC SQL
OPEN DT2
USING
: CTRL-YEAR
,:CTRL-QTR
END-EXEC
EXEC SQL
FETCH DT2
USING DESCRIPTOR :SQLDA2
END-EXEC.
THe problem statement : while fetching the data from the cursor. we expect the cursor to stop after a year and quarter is processed. Say we want to fetch the data for 2012 and 4th quarter, cursor doesnt stop after all the data for the above mentioned year and quarter is processed and did not give a SQL code 100 after all the rows have been processed. Instead the cursor continues to fetch the data for 2013 and 1st quarter as well .
Please sugeest!! |
|
| Back to top |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1325 Location: Vilnius, Lithuania
|
|
|
|
Wij runderen, wij glunderen...
You use Dynamic SQL, so show us the contents of
That's how SQL injections work... |
|
| Back to top |
|
 |
|
|