Dynamic Standard Cursors

Embedded SQL for C and SQL Server

Embedded SQL for C and SQL Server

Dynamic Standard Cursors

In a dynamic standard cursor, committed changes made by anyone and uncommitted changes made by the cursor owner become visible the next time the user fetches data. Changes include insertions and deletions, as well as changes in order and membership. (Deleted rows do not leave holes.) Dynamic standard cursors cannot use a GROUP BY or HAVING clause. Dynamic standard cursors can use an ORDER BY clause in Microsoft® SQL Server™ version 6.5 and later, but only if the table has a unique index.

Specify dynamic standard cursors by issuing the SET SCROLLOPTION DYNAMIC statement. This statement sets the keyset equal to the size of the fetch buffer, which is one row in Embedded SQL. Given a result set of n rows, the keyset and the fetch buffer are identical. They both contain a single row, which moves forward through the result set as each FETCH statement is executed.