RE: Foreach and Begin Work
Posted in 1999
You should probably THFineM on cursors, and transactions. All open cursors are automatically closed on a commit work statement. Also several other things happen that I won't get into. In order to do what you want, you must declare your cursors 'with hold'. HTH -----Original Message----- From: Randy Hao [SMTP:rhao@sprynet.com] Posted At: Friday, June 25, 1999 12:07 PM Posted To: Informix Conversation: Foreach and Begin Work Subject: Foreach and Begin Work I have small code in stored procedure like this on exception set error_code rollback work; end exception foreach select .... begin work .... commit work; end foreach After the SP hits the 'commit work' command at the first row, it closes the cursor and never goes to the next row(showing from trace file). If I use following code, all rows will be effected on exception set error_code rollback work; end exception begin work foreach select .... .... end foreach commit work; Is it true that 'begin work can not used in 'foreach' loop. If possible, I like use the first sample code instead of second one. We use Informix SE 7.20 on HP Unix 10.2