`
chenqi210
  • 浏览: 76955 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

ODBC Cursor

    博客分类:
  • ODBC
 
阅读更多

 

http://msdn.microsoft.com/en-us/library/aa215458%28v=sql.80%29.aspx 写道
To set cursor options

Call SQLSetStmtAttr to set or SQLGetStmtAttr to get the statement options that control cursor behavior.
Foption Specifies
SQL_ATTR_CURSOR_TYPE Cursor type of forward-only, static, dynamic, or keyset-driven
SQL_ATTR_CONCURRENCY Concurrency control option of read-only, locking, optimistic using timestamps, or optimistic using values
SQL_ATTR_ROW_ARRAY_SIZE Number of rows retrieved in each fetch
SQL_ATTR_CURSOR_SENSITIVITY Cursor that does or does not show updates to cursor rows made by other connections
SQL_ATTR_CURSOR_SCROLLABLE Cursor that can be scrolled forward and backward

 

总结一下。cursor的属性大致有五类:

SQL_ATTR_CURSOR_TYPE

SQL_ATTR_CONCURRENCY

SQL_ATTR_ROW_ARRAY_SIZE

SQL_ATTR_CURSOR_SENSITIVITY

SQL_ATTR_CURSOR_SCROLLABLE

 

除去中间的项。其他几项之间都不是互相独立的,关于相互联系的印证可以参考如下地址:

http://msdn.microsoft.com/en-us/library/ms712466%28v=vs.85%29.aspx

 

 

=========================================================================

SQL_CURSOR_ROLLBACK_BEHAVIOR & SQL_CURSOR_COMMIT_BEHAVIOR

=========================================================================

http://msdn.microsoft.com/en-us/library/ms716544%28v=VS.85%29.aspx 写道
To determine how transaction operations affect cursors, an application calls SQLGetInfo with the SQL_CURSOR_ROLLBACK_BEHAVIOR and SQL_CURSOR_COMMIT_BEHAVIOR options. For more information, see the following paragraphs and also see Effect of Transactions on Cursors and Prepared Statements.

If the SQL_CURSOR_ROLLBACK_BEHAVIOR or SQL_CURSOR_COMMIT_BEHAVIOR value equals SQL_CB_DELETE, SQLEndTran closes and deletes all open cursors on all statements associated with the connection and discards all pending results. SQLEndTran leaves any statement present in an allocated (unprepared) state; the application can reuse them for subsequent SQL requests or can call SQLFreeStmt or SQLFreeHandle with a HandleType of SQL_HANDLE_STMT to deallocate them.

If the SQL_CURSOR_ROLLBACK_BEHAVIOR or SQL_CURSOR_COMMIT_BEHAVIOR value equals SQL_CB_CLOSE, SQLEndTran closes all open cursors on all statements associated with the connection. SQLEndTran leaves any statement present in a prepared state; the application can call SQLExecute for a statement associated with the connection without first calling SQLPrepare.

If the SQL_CURSOR_ROLLBACK_BEHAVIOR or SQL_CURSOR_COMMIT_BEHAVIOR value equals SQL_CB_PRESERVE, SQLEndTran does not affect open cursors associated with the connection. Cursors remain at the row they pointed to prior to the call to SQLEndTran.
 
分享到:
评论

相关推荐

    php.ini-development

    ;;;;;;;;... 1.... 2.... 3.... 4.... 5.... 6.... The syntax of the file is extremely simple.... Section headers (e.g.... at runtime.... There is no name validation.... (e.g.... previously set variable or directive (e.g....

    用php和MySql来与ODBC数据连接

    ODBC 是指开放数据连接,它是微软主导的数据驱动程序,它可以与其它数据...是连接至ODBC数据库 dsn ,user,password 是对应着ODBC里的内容,cursor_type是选择游标类型,(可以查考其他文档,在这里我用它默认值) int odbc_d

    Java获取Oracle存储过程返回的Cursor

    Java获取Oracle存储过程返回的Cursor,使用odbc6

    MDAC2.8 下载!!!!!!!!!!!!!1

    and service components, which process and transport data (such as query processors and cursor engines). In addition, OLE DB includes a bridge to ODBC to enable continued support for the broad range ...

    PHP PDOStatement::getAttribute讲解

    PDOStatement::getAttribute ...说明 ...PDO::ATTR_CURSOR_NAME (Firebird 和 ODBC 特性): 获取 UPDATE … WHERE CURRENT OF 的游标名称。 返回值 返回属性值。 总结 以上就是这篇文章的全部内容了

    SQL技术文摘

    cursor之诊断) 数据挖掘 SQL Server 2005:你应该知道的13件事情 存储过程和触发器 错误提示:OLE DB error: OLE DB or ODBC error: Query timeout expired HYT00 SQL Server 2005——你应该知道的...

    Devart_UniDAC_7.4.12_Professional_D7-D10.3_Rio_Full_Source_Code

    Bug with open REFCURSOR is fixed SQLServer data provider Bug with the "Cannot modify a read-only dataset" error in Android is fixed MySQL data provider Bug with setting the data type of the parameter ...

    python_with_sql:Sparta培训-带有SQL的Python

    带有SQL的Python与PYODBC建立连接 如果有任何... connect ( 'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server + ';DATABASE=' + database + ';UID=' + username + ';PWD=' + password )cursor = docker_Nort

    PL/SQL 基础.doc

    2) ODBC 3) OCI: C语言和数据库打交道的方法,和Pro*C很相似,更底层,很少用 只适合ORACLE; 4) SQLJ: 很新的一种用Java访问Oracle数据库的方法,会的人不多; 5) JDBC 6) PL/SQL: 存储在数据库内运行, 其他...

    QT选择性深度裁剪,图文解析

     -no-sql-sqlite -no-sql-mysql -no-sql-psql -no-sql-oci -no-sql-tds -no-sql-odbc -no-sql-db2 -no-sql-sqlite2 -no-sql-ibase\  -no-libjpeg \  -no-gif \  -qt-zlib \  -qt-libpng \  -no-libmng \  -no...

    CursorAdapter(CA)相关资料

    我从网络下载的有关 CursorAdapter(CA)相关资料,其中有: 介绍CursorAdapter类 CursorAdapter 起步 ...vfp9.0 C/S(ODBC)方面极富人性化的增强(作者:mihu) vfp9 CursorAdapter 事务应用的2个注意事项(作者:mihu)

    Python使用pyodbc访问数据库操作方法详解

    本文实例讲述了Python使用pyodbc访问数据库操作方法。 数据库连接 ...工具库安装 在此基础上安装pyodbc工具库,在cmd...检验是否可以正常连接数据库检查是否有一个Microsoft Access ODBC驱动程序可用于你的Python环境(在W

    精通SQL 结构化查询语言详解

    2.1.2 数据库访问标准化接口-ODBC  2.1.3 使用查询分析器执行SQL语句  2.2 Transact-SQL  2.2.1 Transact-SQL 概述  2.2.2 Transact-SQL的主要组成  2.2.3 Transact-SQL的一些重要命令  2.3 Oracle...

    PLSQL.Developer(X32) v12.0.1.1814主程序+ v11中文包+keygen

    The Text Importer and ODBC Importer can now also truncate a table before import, in addition to the "Delete" option. The truncate option is faster but cannot be rolled back. The Compile Invalid ...

    plsqldev12.0.4.1826x32主程序+ v12中文包+keygen

    The Text Importer and ODBC Importer can now also truncate a table before import, in addition to the "Delete" option. The truncate option is faster but cannot be rolled back. The Compile Invalid ...

    PLSQL.Developer(X64) v12.0.1.1814 主程序+ v11中文包+keygen

    The Text Importer and ODBC Importer can now also truncate a table before import, in addition to the "Delete" option. The truncate option is faster but cannot be rolled back. The Compile Invalid ...

    plsqldev12.0.4.1826x64主程序+ v12中文包+keygen

    The Text Importer and ODBC Importer can now also truncate a table before import, in addition to the "Delete" option. The truncate option is faster but cannot be rolled back. The Compile Invalid ...

    精通SQL--结构化查询语言详解

    2.1.2 数据库访问标准化接口—odbc 22 2.1.3 使用查询分析器执行sql语句 22 2.2 transact-sql 24 2.2.1 transact-sql 概述 24 2.2.2 transact-sql的主要组成 25 2.2.3 transact-sql的一些重要命令 26 2.3 ...

    SQL21日自学通

    ODBC 282 Personal Oracle 7283 InterBase SQL ISQL 283 Visual C++ 284 Delphi284 设置284 创建数据库285 使用MS QUERY 来完成链接290 将VISUAL C++与SQL 结合使用292 将DELPHI 与SQL 结合使用296 总结302 问与答...

Global site tag (gtag.js) - Google Analytics