I have a loop e.g.
DECLARE SQL VARCHAR(1024);
FOR V AS CUR1 CURSOR FOR (SELECT 'Select * from My_Table' from ... )
DO
SET SQL = CUR1;
PREPARE S1 FROM SQL;
EXECUTE S1;
END FOR;
This does not seem to work. I have successfully done similar to this when the cursor in the for loop points to some row returned and I can access the value e.g. like this:
SET SQL = CUR1.TABNAME
But now that the returned value is a string, I have no idea how to get it from the cursor. Any ideas?