What means are cursor types?? where are manuals??
Posted in 1999
Topics: General Discussion
cursor is id of rows of table.(as I know...) I have found cursors that found sequential, scroll, hold, and update but I don't understand four types of cursor what means are cursor types?? where are manual?? --------------------------- soph@doit.ajou.ac.kr
Check the Informix application manuals for info on cursors. For example, look under "DECLARE CURSOR" in the 4GL reference manual. The types are as follows: Sequential cursors can only access rows from a SELECT statement in sequential order. Scroll cursors can access rows from a SELECT statement forwards and backwards, or access specific rows by absolute position. Update cursors are used to lock a selected row for update. I'm not sure what a "hold" cursor refers to, but there is another cursor type, the INSERT cursor, that is used to insert multiple rows into a table more efficiently. Chang-Woo Park wrote in message ... >cursor is id of rows of table.(as I know...) > >I have found cursors that found sequential, scroll, hold, and update > >but I don't understand four types of cursor > >what means are cursor types?? where are manual?? > >--------------------------- >soph@doit.ajou.ac.kr
Chang-Woo Park wrote: > > cursor is id of rows of table.(as I know...) > > I have found cursors that found sequential, scroll, hold, and update > > but I don't understand four types of cursor > > what means are cursor types?? where are manual?? The manuals are online at the Informix WEB Site (www.informix.com). Cursors: Sequential (or not options): Normal cursor. One can FETCH from the cursor all rows in order from first to last only. If a transaction is committed the cursor will close automatically. Hold cursor: This is declared by adding the WITH HOLD clause to the cursor declaration. This clause causes the cursor to survive a transaction COMMIT or ROLLBACK. Scroll cursor: Scroll cursors are delared by adding the SCROLL keyword to the cursor declaration. A scroll cursor can be navigated forwards or backwards or randomly using various additions to the FETCH command namely: FIRST, LAST, NEXT, PREVIOUS, RELATIVE n, ABSOLUTE n, CURRENT Update cursor: Declared by adding the FOR UPDATE and optionally OF (columnlist) clauses causes the cursor to obtain an update lock on each row as it is FETCHED by the application. Depending on the isolation level the locks may be retained for all rows fetched or only for rows actually updated (and released for others) until the end of the current transaction. It is then only necessary in the WHERE clause of an update statement to include the CURRENT OF cursor_name clause to update the currently fetched row VERY quickly without additional index searches. Hope that helps. Art S. Kagel