When Cursor is closed?
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
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?
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?
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? > >
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?
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 :-)