Difference between revisions of "SQLMORERESULTS()"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Check if more results sets are available and if so, copy next results set to a cursor | Check if more results sets are available and if so, copy next results set to a cursor | ||
Line 15: | Line 8: | ||
==See Also== | ==See Also== | ||
− | [[CREATE CONNECTION]], [[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLEXEC()]], [[SQLGETPROP()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSETPROP()]], [[SQLSTRINGCONNECT()]], [[SQLTABLES()]] | + | [[CREATE CONNECTION]], [[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLERROR()]], [[SQLEXEC()]], [[SQLGETPROP()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSETPROP()]], [[SQLSTRINGCONNECT()]], [[SQLTABLES()]] |
Line 56: | Line 49: | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | nStatHand=SQLSTRINGCONNECT("rec@rec1:user1/pass1 | + | nStatHand=SQLSTRINGCONNECT("rec@rec1:user1/pass1-southwind.tcpip",.T.) |
if nStatHand < 1 | if nStatHand < 1 | ||
messagebox('Cannot make connection', 16, 'SQL Connect Error') | messagebox('Cannot make connection', 16, 'SQL Connect Error') | ||
Line 63: | Line 56: | ||
store "00010" to myVar | store "00010" to myVar | ||
SQLEXEC(nStatHand, "SELECT * FROM example WHERE account_no = ?myVar", "restab") | SQLEXEC(nStatHand, "SELECT * FROM example WHERE account_no = ?myVar", "restab") | ||
+ | display all | ||
SQLMORERESULTS(nStatHand) | SQLMORERESULTS(nStatHand) | ||
− | |||
SQLDISCONNECT(nStatHand) | SQLDISCONNECT(nStatHand) | ||
endif | endif | ||
</code> | </code> | ||
− | |||
==Products== | ==Products== | ||
− | Recital | + | Recital, Recital Server |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:SQL]] | [[Category:SQL]] | ||
+ | [[Category:Remote Data Connectivity Functions]] |
Latest revision as of 16:15, 4 July 2011
Purpose
Check if more results sets are available and if so, copy next results set to a cursor
Syntax
SQLMORERESULTS(<nStatementHandle>)
See Also
CREATE CONNECTION, SQLCANCEL(), SQLCOLUMNS(), SQLCOMMIT(), SQLCONNECT(), SQLDISCONNECT(), SQLERROR(), SQLEXEC(), SQLGETPROP(), SQLPREPARE(), SQLROLLBACK(), SQLSETPROP(), SQLSTRINGCONNECT(), SQLTABLES()
Description
The SQLMORERESULTS() function is used in non-BatchMode to check whether more results sets are available and if so, to copy the next results set to a cursor. BatchMode is set using the SQLSETPROP() function. BatchMode is always True and cannot be used to return results sets individually. It is included for compatibility reasons only.
The SQLMORERESULTS() function operates on the data source specified by <nStatementHandle>.
Keywords | Description |
---|---|
nStatementHandle | The workarea in which the gateway data source is open |
Valid Return values:
Return Value | Description |
---|---|
2 | No more data found |
1 | SQL statement has finished executing |
0 | SQL statement is still executing |
–1 | Connection error |
–2 | Environment error |
SQLMORERESULTS() always returns 2.
Example
nStatHand=SQLSTRINGCONNECT("rec@rec1:user1/pass1-southwind.tcpip",.T.) if nStatHand < 1 messagebox('Cannot make connection', 16, 'SQL Connect Error') else messagebox('Connection made', 48, 'SQL Connect Message') store "00010" to myVar SQLEXEC(nStatHand, "SELECT * FROM example WHERE account_no = ?myVar", "restab") display all SQLMORERESULTS(nStatHand) SQLDISCONNECT(nStatHand) endif
Products
Recital, Recital Server