returns an integer that specifies the current position in a result set.
Details and Options
Examples
Basic Examples
Possible Issues
See Also
Tech Notes
Related Guides
DatabaseLink`
DatabaseLink`
SQLResultSetPosition
returns an integer that specifies the current position in a result set.
Details and Options
- To use SQLResultSetPosition, you first need to load DatabaseLink using Needs["DatabaseLink`"].
Examples
open all close allBasic Examples (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];