The
SQLCode code property is used to get the SQL code of a query created with the query editor (".WDR" file). The comments entered in the query editor are visible in the SQL code.
// Assigns the SQL code of the query to a string
MySQLCode is string
MySQLCode = QRY_QueryCalculation.SQLCode
Syntax
Finding out the SQL code of a query Hide the details
<SQL code> = <Query used>.SQLCode
<SQL code>: Character string
SQL code of the specified query. If the ".WDR" file contains comments, these comments will be found in the SQL code of the query (the comments start with "--").
<Query used>: Query name
Logical name of the query used. This name was defined in the query editor.
Remarks
Formatting the result
The SQL code of the query is identical to the one displayed in the query editor via "SQL code" in the context menu of the query: the space characters, the tabulations and the CR characters are kept.
Use in the HFSQL stored procedures
The SQLCode property can be used in the code of a stored procedure to get the code of a stored query on the server.