Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Chang-Woo Park, learning ESQL/C, asked when a cursor is closed and when a WITH HOLD cursor is closed. Vic Glass and Khem Chander said: on program end, explicit CLOSE, or COMMIT/ROLLBACK WORK unless WITH HOLD, which stays open until closed. Art S. Kagel added SET CONNECTION without concurrent transactions, FREE, and DISCONNECT. Fuzzy asked how to preserve cursors on commit in ODBC 2.8 DSNs; unanswered.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Chang-Woo Park — — source: Informix-list mailing list archive (1991-1998)
I learn to develop application using Informix ESQL/C
First Qustion, When Cursor is closed?
Sencond Qustion, Cursor is created with 'WITH HOLD' option,
When Cursor is closed?
↪ replying to Chang-Woo Park
Vic Glass — — source: Informix-list mailing list archive (1991-1998)
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).
Your second question is answered in part 3., above.
Chang-Woo Park wrote:
> I learn to develop application using Informix ESQL/C
>
> First Qustion, When Cursor is closed?
>
> Sencond Qustion, Cursor is created with 'WITH HOLD' option,
> When Cursor is closed?
↪ replying to Chang-Woo Park
Khem Chander — — source: Informix-list mailing list archive (1991-1998)
HI Buddy,
cursor is close when you issue close cursor statatement. it is also
closed when you issue a commit work or rollback work statemenet. If you
create a cursor with hold thatn on commit/rollback work , cursor is not
closed until you close it manually.
thanks,
khem chander
kchande@yahoo.com
Chang-Woo Park <soph@infox.ajou.ac.kr> wrote in article
<slrn7k2lll.1kq.soph@infox.ajou.ac.kr>...
> I learn to develop application using Informix ESQL/C
>
> First Qustion, When Cursor is closed?
>
> Sencond Qustion, Cursor is created with 'WITH HOLD' option,
> When Cursor is closed?
>
>
↪ replying to Vic Glass
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
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
> Your second question is answered in part 3., above.
>
> Chang-Woo Park wrote:
>
> > I learn to develop application using Informix ESQL/C
> >
> > First Qustion, When Cursor is closed?
> >
> > Sencond Qustion, Cursor is created with 'WITH HOLD' option,
> > When Cursor is closed?
↪ replying to Art S. Kagel
Fuzzy — — source: Informix-list mailing list archive (1991-1998)
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
:-)
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.