ICubeLoaderInstance.Execute

Syntax

Execute(

Selection: IDimSelectionSet;

[Progress: ICubeProgress = Null;]

[Options: AutoCubeUpdateOption = 0]): ICubeOperationResult;

Parameters

Selection - selection of consumer cube elements, by which data loading is executed.

Progress - optional parameter that determines an object that is used to track loading. This parameter is not supported.

Options - optional parameter that determines the mode of data check on saving. One value or combination of values of the AutoCubeUpdateOption enumeration type is specified as a value of the parameter. Values in the list are separated with the Or keyword.

Description

The Execute method loads data to the consumer cube according to the selection passed by the Selection parameter.

Example

Executing the example requires a data loader with the CUBE_LOAD identifier configured to pass data from source cube to consumer cube.

Sub Main;

Var

MB: IMetabase;

CubLoadInst: ICubeLoaderInstance;

DimSS: IDimSelectionSet;

i: Integer;

Result: ICubeOperationResult;

Begin

MB := MetabaseClass.Active;

CubLoadInst := MB.ItemById("CUBE_LOAD").Open(Null) As ICubeLoaderInstance;

DimSS := CubLoadInst.Destination.CreateDimSelectionSet;

For i := 0 To DimSS.Count - 1 Do

DimSS.Item(i).SelectAll;

End For;

Result := CubLoadInst.Execute(DimSS, Null, AutoCubeUpdateOption.NoCheckDuplicates Or AutoCubeUpdateOption.GetResult);

Debug.WriteLine("Loader name: " + Result.Name);

Debug.WriteLine("Loader identifier: " + Result.Id);

Debug.WriteLine("Start of loading: " + Result.TimeStart.ToString);

Debug.WriteLine("End of loading: " + Result.TimeFinish.ToString);

If Result.Succeeded Then

Debug.WriteLine("Data loading has been completed successfully");

Debug.WriteLine("Processed records: " + Result.RecordsProcessed.ToString);

Else

Debug.WriteLine("Error occurred while loading data");

Debug.WriteLine("Error: " + Result.Error.Message);

End If;

WinApplication.InformationBox(Result.FormattedMessage);

End Sub Main;

After executing the example data is loaded into the cube. The results of loading are displayed in the console window and as an information message. On loading data, check for duplicates is not executed. Loading is executed by all elements of consumer cube.

See also:

ICubeLoaderInstance