I'm doing this in a program:
for i = 1 to 9; exec SQL PREPARE dynPrep FROM :dynSelect; exec SQL DECLARE i1 CURSOR for dynPrep; exec SQL OPEN i1; exec SQL FETCH i1 INTO :qtyOH; // write to a subfile exec SQL CLOSE i1; endfor;
The code runs fine for 5 or 6 iterations, then it returns SQLSTATE 26501. "Prepared statement dynprep not found."
Unique? i know. Not sure where go to from here though.