You have to use a cursor 'WITH HOLD' !!!
Hope this helps,
Octav
On Fri, Jun 25, 1999 at 12:06:33PM -0400, Randy Hao wrote:
> 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
>
--
Octav Chiriac Phone: (373) 2 22 99 67
NetInfo S.R.L. Fax: (373) 2 21 36 59
Chisinau (373) 2 24 00 83
Moldova, Republic of mailto:com@netinfo-moldova.com