ODBC Cursor

 

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.
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值