Method DacSession():executeQuery() Professional

Executes an SQL SELECT statement.

:executeQuery( <cSqlStmt>, [<cAlias>], [<lNewArea>] )
<cSqlStmt> is a character string with the SQL statement to be sent to the server. The SQL statement must be an SQL SELECT statement which returns a single result set.
The argument <cAlias> specifies the alias name to be used to identify the work area of the result set. It is an optional character string. When <cAlias> is not specified, the alias name "QUERY" is used. If "QUERY" is already being used, the ordinal of the work area is appended to the alias name. For example, "QUERY_2".
<lNewArea> is a logical value specifying whether a new work area is to be selected before the statement is executed. Including <lNewArea> is optional and the default value is .F. (false). If <lNewArea> contains the value .T. (true), a new free work area is selected. Otherwise, the current work area is closed before the statement is executed and the result set is returned in this work area.

The method returns .T. (true) when the statement is executed successfully. Otherwise .F. (false) is returned and detailed error information can be retrieved using :getLastError().



:executeQuery() is a low level SQL support method. Use Universal SQL or the SQLStatement class instead.

A result is read-only and cannot be changed.

If <cSqlStmt> executes a stored procedure which returns more than one result set, only the first result set is retrieved.


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.