|
- Overview
- Using HExecuteQuery to pass parameters to a query
- Syntax to use
- Using the . notation
- Syntax to use
- Avoid specifying all the parameters
- Unspecified query parameters
Two methods for passing parameters to a query
Two methods can be used to pass parameters to a query with parameters used in a window or in a control (List Box, Combo Box or Table control for example): This help page presents the operating mode and the benefits of each one of these methods. Remark: From version 19, HFSQL is the new name of HyperFileSQL. Using HExecuteQuery to pass parameters to a query Syntax to use When a query is run by HExecuteQuery, the last parameters passed to the function correspond to the parameters of the query. The following syntax is used:
<Result> = HExecuteQuery(<Query Name> [, <Connection>] [, <Mode> [, <Parameters> [, ...]]])
Caution: In this case: - The values of the query parameters must be specified in their initialization order (visible in the query editor). Each parameter must correspond to the expected type. The different parameters are separated by a comma.
- To specify the parameters of the query, you must specify the initialization mode of the query.
Using the <Query name>.<Parameter name> notation Syntax to use To pass parameters to a query, all the query parameters can be specified to the HFSQL engine before running the query. This method allows you to specify the parameters in any order (useful for the queries that require several parameters). The following syntax must be used:
<Query name>.<Name of parameter 1> = <Value of parameter 1> <Query name>.<Name of parameter 2> = <Value of parameter 2> ... <Query name>.<Name of parameter N> = <Value of parameter N>
<Result> = HExecuteQuery(<Query name> [ , <Connection>] [, <Mode>])
Caution: - The name of the parameter must be the name specified when the query was created in the query editor. This name must differ from an item name.
- The indirection operators or the dynamic compilation (Compile) cannot be used with this syntax.
- Each time the HExecuteQuery function is executed, the parameters are reset to 0.
- If at least one parameter is specified in HExecuteQuery, all the parameters specified beforehand are ignored.
- The value of the parameter can correspond to NULL.
- If one of the parameters is not specified, the corresponding condition is ignored.
Avoid specifying all the parameters
This page is also available for…
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |