ISQLCallback

Assembly: Db;

Namespace: Prognoz.Platform.Interop.Db;

Description

The ISQLCallback interface contains methods that are used to handle a generation process of query fro cube data extraction.

Inheritance Hierarchy

ISQLCallback

Comments

Methods of the interface must be redefined in the custom class. The class can be set as a handler for cube source using the IStandardCubeDataset.SetCallback method.

Query for data extraction contains several parts. Several parts of the query can be modified in the BeforeConstruction method. Finishing query settings can be made in the AfterConstruction method.

IMPORTANT. Query for cube data extraction can be modified only in extreme case with total confidence in those changes.

See below the list of parts that can be present in query. Angle brackets are not present in the request, they mark the block that can be modified. Syntax of each block depends on the type of DBMS in use.

  1. Main query part where extracted data is specified: select <a.KEY,a.DATE,a.VALUE>. It is modified in the ISQLComponents.Select_ property.

  2. Source from which data is extracted: from <DATA_TABLE a>. It is modified in the ISQLComponents.From_ property.

  3. Full condition of selection for dimension elements: <((a.DATE in ({d'2010-01-01'},{d'2011-01-01'},{d'2012-01-01'}))) and ((a.KEY in (1,2,3,4,5,6,7,8,9,10))))>. It is modified in the ISQLComponents.Where property.

  4. Grouping of results: GroupBy <KEY>. It is modified in the ISQLComponents.GroupBy property.

  5. Expressions for aggregation: <COUNT(DISTINCT a.VALUE )>. It is modified in the ISQLComponents.Aggregation property.

  6. Sorting of results: OrderBy <KEY>. It is modified in the ISQLComponents.OrderBy property.

  7. Set of separate conditions that are included into ISQLComponents.Where. Number of conditions can be obtained in the ISQLComponents.ConditionCount property, the ISQLComponents.Condition property returns a separate condition. It is impossible to modify condition in ISQLComponents.Condition.

  8. Alias that is used in query to reduce names of tables: a. It is possible to get alias in the ISQLComponents.TableAlias property, it is not possible to modify it.

The ISQLComponents.SubQuery property returns whether subqueries are used in query. The ISQLComponents.SubQuery value cannot be modified, the property that is necessary to use subqueries is specified in the IStandardCubeDataset.UseSubqueryOptimization property.

The presence of specific part depends on cube settings and its data source. Any parts can not be present.

Methods

  Method name Brief description
AfterConstruction The AfterConstruction method is called after the query to select cube data is generated.
BeforeConstruction The BeforeConstruction method is called before generating a query to extract cube data.

See also:

Db Assembly Interfaces