One of our developers approached me with a sql question. I thought a cursor
loop would do the job - but I had difficulty getting a simple template to work.
Can one use cursors within a file like this ?
$ db2 -tvf cursor
DECLARE table_cursor CURSOR FOR SELECT name FROM sysibm.systables
DB20000I The SQL command completed successfully.
OPEN table_cursor
DB20000I The SQL command completed successfully.
FETCH table_cursor
DB21030E The cursor "TABLE_CURSOR" has not been opened.
Any constructive advice most welcome, thanks.