Serge Rielau <sr*****@ca.ibm.com> wrote:
J. Moreno wrote: Knut Stolze <st****@de.ibm.com> wrote:
-snip- Wrap the DECLARE CURSOR statement in its own BEGIN ... END block.
Was this added in v8?
I got "...LINE 20 COL 1 NESTED COMPOUND STATEMENTS NOT ALLOWED"
as a build error when I tried that, but I'm using v7.
DB2 for zOS presumably V7?
Yep.
Try a dynamic cursor declaration, that should work.
A stored procedure with this....
-- start here
BEGIN
DECLARE cursor1 INSENSITIVE SCROLL CURSOR WITH RETURN FOR
SELECT count(aColumn) FROM aTable;
-- Cursor left open for client application
OPEN cursor1;
END:
-- end here
compiles. Wrapping that in an extra begin/end gets the above error
message.
--
J. Moreno