IAdoMdCatalogInstance.RefreshBySQL

Fore Syntax

RefreshBySQL(SqlText: String);

Fore.NET Syntax

RefreshBySQL(SqlText: string);

Parameters

SqlText. MDX query text.

Description

The RefreshBySQL method refreshes contents of the ADOMD catalog by running the specified MDX query.

Comments

If the query contains information about not yet existing ADOMD cube, it will be created.

The text of the specified MDX query has some restrictions:

To refresh the contents of the ADOMD catalog according to its contents in the server, use the IAdoMdCatalogInstance.Refresh method.

Fore Examples

Executing the example requires that the repository contains an ADOMD catalog with the ADOMDTest identifier. This catalog contains ADOMD dimensions required to create a cube. Add links to the AdoMd and Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Catalog: IAdoMdCatalogInstance;
    MDX: String;
Begin
    MB := MetabaseClass.Active;
    Catalog := MB.ItemById("ADOMDTest").Open(NullAs IAdoMdCatalogInstance;
    //MDX query
    MDX := "select [Commodities].[Commodity].members on rows, [Time].[Year].members on columns from [PricesForecast] where [Measures].[Value]";
    //Create a new cube based on MDX query
    Catalog.RefreshBySQL(MDX);
End Sub UserProc;

After executing the example a new ADOMD cube is created based on the specified MDX query in the ADOMD catalog.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.AdoMd;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Catalog: IAdoMdCatalogInstance;
    MDX: String;
Begin
    MB := Params.Metabase;
    Catalog := MB.ItemById["ADOMDTest"].Open(NullAs IAdoMdCatalogInstance;
    //MDX query
    MDX := "select [Commodities].[Commodity].members on rows, [Time].[Year].members on columns from [PricesForecast] where [Measures].[Value]";
    //Create a new cube based on MDX query
    Catalog.RefreshBySQL(MDX);
End Sub;

See also:

IAdoMdCatalogInstance