ICubeCacheSaver.SaveCache

Syntax

SaveCache(

DestKey: Integer;

ParamValues: IMetabaseObjectParamValues;

Selections: IDimSelectionSet;

Value: IMatrix);

Parameters

DestKey. The key of the required cube display version.

ParamValues. Parameters of the specified caching object.

Selections. The collection of selections in the specified cube display version.

Value. Matrix of cube values.

Description

The SaveCache method saves cache for the cube display version by the specified parameters.

Example

Executing the example requires that the repository contains a database with the DB identifier and a cube with the D_SEP identifier.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    CacheSaver: ICubeCacheSaver;
    CrInfo: IMetabaseObjectCreateInfo;
    CubIn: ICubeInstance;
    Dest: ICubeInstanceDestination;
    SelSet: IDimSelectionSet;
    i: Integer;
    Sel: IDimSelection;
    Mat: IMatrix;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("D_SEP");
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_CUBE_CACHE_SAVER;
    CrInfo.Parent := MObj;
    CrInfo.Permanent := True;
    CacheSaver := MB.CreateObject(CrInfo).Edit As ICubeCacheSaver;
    CacheSaver.Database := MB.ItemById("DB").Bind As IDatabase;
    (CacheSaver As IMetabaseObject).Save;
    CubIn := MObj.Open(NullAs ICubeInstance;
    Dest := CubIn.Destinations.DefaultDestination;
    SelSet := Dest.CreateDimSelectionSet;
    For Each Sel In SelSet Do
        Sel.SelectAll;
    End For;
    Mat := Dest.Execute(SelSet);
    CacheSaver.SaveCache(Dest.Key, Null, SelSet, Mat);
End Sub UserProc;

After executing the example the cube cache warehouse is created in the specified database.

See also:

ICubeCacheSaver