Επεξεργασία

Κοινή χρήση μέσω


SQLGetInfo (Cursor Library)

Important

This feature will be removed in a future version of Windows. Avoid using this feature in new development work and plan to modify applications that currently use this feature. Microsoft recommends using the driver's cursor functionality.

This topic discusses the use of the SQLGetInfo function in the cursor library. For general information about SQLGetInfo, see SQLGetInfo Function.

The cursor library returns values for the following values of InfoType (| represents a bitwise OR); for all other values of InfoType, it calls SQLGetInfo in the driver.

InfoType Returned value
SQL_BOOKMARK_PERSISTENCE SQL_BP_SCROLL
SQL_DYNAMIC_CURSOR_ATTRIBUTES1 0
SQL_DYNAMIC_CURSOR_ATTRIBUTES2 0
SQL_FETCH_DIRECTION[1] SQL_FD_FETCH_ABSOLUTE | SQL_FD_FETCH_FIRST | SQL_FD_FETCH_LAST | SQL_FD_FETCH_NEXT | SQL_FD_FETCH_PRIOR | SQL_FD_FETCH_RELATIVE | SQL_FD_FETCH_BOOKMARK
SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 SQL_CA1_NEXT | SQL_CA1_ABSOLUTE | SQL_CA1_RELATIVE | SQL_CA1_LOCK_NO_CHANGE | SQL_CA1_POS_POSITION | SQL_CA1_POSITIONED_DELETE | SQL_CA1_POSITIONED_UPDATE | SQL_CA1_SELECT_FOR_UPDATE
SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 SQL_CA2_READ_ONLY_CONCUR | SQL_CA2_OPT_VALUES_CONCURRENCY | SQL_CA2_SENSITIVITY_UPDATES
SQL_GETDATA_EXTENSIONS SQL_GD_BLOCK | any values returned by the driver Note: When data is retrieved with SQLFetchScroll, SQLGetData supports the functionality specified with the SQL_GD_ANY_COLUMN and SQL_GD_BOUND bitmasks.
SQL_KEYSET_DRIVEN_CURSOR_ATTRIBUTES1 0
SQL_KEYSET_DRIVEN_CURSOR_ATTRIBUTES2 0
SQL_LOCK_TYPES[1] SQL_LCK_NO_CHANGE
SQL_STATIC_CURSOR_ATTRIBUTES1 SQL_CA1_NEXT | SQL_CA1_ABSOLUTE | SQL_CA1_RELATIVE | SQL_CA1_BOOKMARK | SQL_CA1_LOCK_NO_CHANGE | SQL_CA1_POS_POSITION | SQL_CA1_POSITIONED_DELETE | SQL_CA1_POSITIONED_UPDATE | SQL_CA1_SELECT_FOR_UPDATE
SQL_STATIC_CURSOR_ATTRIBUTES2 SQL_CA2_READ_ONLY_CONCUR | SQL_CA2_OPT_VALUES_ CONCURRENCY | SQL_CA2_SENSITIVITY_UPDATES
SQL_POS_OPERATIONS[1] SQL_POS_POSITION
SQL_POSITIONED_STATEMENTS[1] SQL_PS_POSITIONED_DELETE | SQL_PS_POSITIONED_UPDATE | SQL_PS_SELECT_FOR_UPDATE
SQL_ROW_UPDATES "Y"
SQL_SCROLL_CONCURRENCY[1] SQL_SCCO_READ_ONLY | SQL_SCCO_OPT_VALUES
SQL_SCROLL_OPTIONS SQL_SO_FORWARD_ONLY | SQL_SO_STATIC
SQL_STATIC_SENSITIVITY[1] SQL_SS_UPDATES

[1] Used only when the cursor library is used with an ODBC 2.x driver.

Important

The cursor library implements the same cursor behavior when transactions are committed or rolled back as the data source. That is, committing or rolling back a transaction, either by calling SQLEndTran or by using the SQL_ATTR_AUTOCOMMIT connection attribute, can cause the data source to delete the access plans and close the cursors for all statements on a connection. For more information, see the SQL_CURSOR_COMMIT_BEHAVIOR and SQL_CURSOR_ROLLBACK_BEHAVIOR information types in SQLGetInfo.