IQuery.SubstituteAllParamsInQuery

Syntax

SubstituteAllParamsInQuery: Boolean;

SubstituteAllParamsInQuery: boolean;

Description

The SubstituteAllParamsInQuery property determines whether all parameters values to query body on execution.

Comments

Available values:

Example

Executing the example requires that repository contains a query with the QUERY identifier. The query must contain parameters and query text where the parameters are used.

Add links to the Metabase, Db 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;

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Db;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Query: IQuery;
Begin
    MB := Params.Metabase;
    
// 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;

After executing the example, all parameters values will be placed to query body on its execution, therefore query execution time will reduce.

See also:

IQuery