An "end foreach" will also close a cursor.
-----Original Message-----
From: Fuzzy [SMTP:granta@nospam.student.canberra.edu.au]
Sent: Wednesday, May 19, 1999 9:03 PM
To: informix-list@iiug.org
Subject: Re: When Cursor is closed?
On Wed, 19 May 1999 15:38:57 -0400, "Art S. Kagel"
<kagel@bloomberg.net> wrote:
>Vic Glass wrote:
>>
>> Good question.
>>
>> A cursor is closed under three conditions (that I know
of):
>> 1. The program terminates.
>> 2. The CLOSE sql statement is used explicitly.
>> 3. A transaction is finished with either COMMIT WORK or
ROLLBACK WORK
>> (providing the cursor was not not declared as WITH HOLD).
>
>Also:
> 4. Switching connections with SET CONNECTION
<connectionname> if the
>current connection was not opened with the "WITH CONCURRENT
>TRANSACTIONS" option.
> 5. FREE <cursorname> will also close the cursor before
freeing it.
> 6. FREE <statementname> will close and free any cursor
opened against
>the statementname being freed.
> 7. (An obvious one) DISCONNECT or sqlexit() are executed.
>
>Art S. Kagel
Art,
The old ODBC/CLI (from 2.5) used to have an option on the
driver to
preserve cursors on commit. The new one (from 2.8) doesn't.
As you
are the guru of all things Informix, any ideas how I might
set this in
for 2.8 ODBC DSNs?
Ciao
Fuzzy
:-)