returns an integer that specifies the current position in a result set.
更多信息和选项
范例
基本范例
Possible Issues
参见
技术笔记
相关指南
DatabaseLink`
DatabaseLink`
SQLResultSetPosition
returns an integer that specifies the current position in a result set.
更多信息和选项
- To use SQLResultSetPosition, you first need to load DatabaseLink using Needs["DatabaseLink`"].
范例
打开所有单元 关闭所有单元基本范例 (1)
Needs["DatabaseLink`"]If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the DatabaseLink`DatabaseExamples` package, as described in Using the Example Databases.
conn = OpenSQLConnection["publisher"];rs = SQLResultSetOpen[SQLSelect[conn, "roysched"]];The initial position is always 0:
SQLResultSetPosition[rs]SQLResultSetGoto[rs, 3];SQLResultSetPosition[rs]SQLResultSetShift[rs, 2];SQLResultSetPosition[rs]SQLResultSetClose[rs]CloseSQLConnection[conn];Possible Issues (1)
Needs["DatabaseLink`"]conn = OpenSQLConnection["publisher"];rs = SQLResultSetOpen[SQLSelect[conn, "roysched"]];There is no data at position 0:
SQLResultSetPosition[rs]SQLResultSetCurrent[rs]There is no data at the end of the result set:
SQLResultSetGoto[rs, Infinity]SQLResultSetPosition[rs]SQLResultSetCurrent[rs]SQLResultSetClose[rs]CloseSQLConnection[conn];