Method SqlStatement:query() Foundation
Executes the given SQL statement which returns a single ResultSet. The result-set is processed according to the <nResultType> definition.
Syntax
METHOD :query([nResultType], [<@xResult> | <cAlias>] ) -> <cAlias>
Parameters
<nResultType>
A define from <sql.ch> which determines how the result-set shall be processed.
Possible ways to handle a result-set
#define | Description |
---|---|
USQL_RESULT_WORKAREA* | The result set is retrieved and available as a workarea in the current workspace. Pass optional Aliasname. |
USQL_RESULT_ARRAY | The result set returned in an array, where each row is an subarray. |
USQL_RESULT_OBJECTS | The result set returned in an array of objects. By default all objects are DataObjects where the prototype name is the the alias name. |
USQL_RESULT_EVAL | The result set not saved on, instead each row of the result is passed as an array to the codeblock wich gets then evaluated. |
USQL_RESULT_SINGLE_VALUE | The result set is assumed to return only one column/one row therefore this single value is assigned to the by reference parameter. |
|
<@xResult>
A variable passed by reference of any type which recieves the result value as specified via the <nResultType> parameter.
<cAlias>
An character string or expression returning an characters string which determines the alias name under which the result set is reference in the current workspace. If the alias name does already exist the ordinal of the workarea is appended to the alias name.
Return
This method returns the aliasname of the workarea or the dataobject prototype
Description
The method :query() is used to retrieve a single result set from the DBMS.
Feedback
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.