SubstituteAllParamsInQuery: Boolean;
The SubstituteAllParamsInQuery property determines whether all parameters values to query body on execution.
Available values:
True. When executing query, all parameters values are placed to the query body instead of parameters names of corresponding SQL literals specified on creating query text. Query execution time depends on parameters data types in use and can be reduced.
False. Default. On query execution, if the parameters values are arrays, then they are placed to the query body, and the other values are placed via parameters.
Executing the example requires that repository contains a query with the QUERY identifier. The query must contain parameters and query textwhere the parameters are used.
Add links to the Db and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Query: IQuery;
Begin
MB := MetabaseClass.Active;
// Get query
MObj := Mb.ItemById("QUERY").Edit;
Query := MObj As IQuery;
// Check whether parameters are taken into account on query execution
If Query.ParamsCheck Then
// Determine substitution of all parameters values on query execution
Query.SubstituteAllParamsInQuery := True;
// Save changes
MObj.Save;
End If;
End Sub UserProc;
After executing the example, all parameters values will be placed to query body on its execution, therefore query execution time will reduce.
See also: