reads the current row from a result set.
更多信息和选项
范例
基本范例
Options
"GetAsStrings"
Possible Issues
参见
技术笔记
相关指南
DatabaseLink`
DatabaseLink`
SQLResultSetCurrent
reads the current row from a result set.
更多信息和选项
- To use SQLResultSetCurrent, you first need to load DatabaseLink using Needs["DatabaseLink`"].
- The following option can be given:
-
"GetAsStrings" False return the results as strings
范例
打开所有单元 关闭所有单元基本范例 (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"]]Shift the current position to the first row:
SQLResultSetShift[rs, 1];SQLResultSetPosition[rs]SQLResultSetCurrent[rs]SQLResultSetClose[rs]CloseSQLConnection[conn];Options (1)
"GetAsStrings" (1)
Needs["DatabaseLink`"]conn = OpenSQLConnection["publisher"];rs = SQLResultSetOpen[SQLSelect[conn, "roysched"]];SQLResultSetShift[rs, 1];SQLResultSetCurrent[rs, "GetAsStrings" -> True]//InputFormSQLResultSetClose[rs]CloseSQLConnection[conn];Possible Issues (1)
Needs["DatabaseLink`"]conn = OpenSQLConnection["publisher"];rs = SQLResultSetOpen[SQLSelect[conn, "roysched"]];There is nothing to read before the first row:
SQLResultSetPosition[rs]SQLResultSetCurrent[rs]There is nothing to read after the last row:
SQLResultSetGoto[rs, Infinity];SQLResultSetPosition[rs]SQLResultSetCurrent[rs]SQLResultSetClose[rs]CloseSQLConnection[conn];