SkipEmptyRows: Boolean;
SkipEmptyRows: boolean;
The SkipEmptyRows property determines whether to skip empty rows on data import.
Available values:
True. Empty rows are skipped on data import.
False. When the first empty row is found in the data source, import is stopped.
Executing the example requires that the repository contains a time series database with the TSDB_IMPORT identifier containing an import object with the OBJ_IMPORT identifier. This object must import data from any source except for time series database.
Add links to the Cubes and Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
RubrKey: Integer;
ImpRequestDefDescr: IMetabaseObjectDescriptor;
ImpRequestDef: IImportRequestDefinition;
ImpProvParams: IImportRequestProviderParams;
Begin
// Get repository
Mb := MetabaseClass.Active;
// Get time series database
RubrKey := Mb.GetObjectKeyById("TSDB_IMPORT");
// Get import object
ImpRequestDefDescr := Mb.ItemByIdNamespace("OBJ_IMPORT", RubrKey);
// Get time series loading parameters
ImpRequestDef := ImpRequestDefDescr.Edit As IImportRequestDefinition;
ImpProvParams := ImpRequestDef.ProviderParams;
// Specify that on import of values that do not correspond to consumer field type
// the Null value is written
ImpProvParams.LoadNullForMissMatchValueType := True;
// Specify that on import a series is overwritten
ImpProvParams.OverWriteWholeFactorValues := True;
// Set length of string field in data source
ImpProvParams.SourceFieldStringSize := 100;
// Specify that on import of values empty rows are skipped
ImpProvParams.SkipEmptyRows := True;
// Specify that on import time series period is not decreased
// in time series database
ImpProvParams.DecreasePeriod := False;
// Specify that date recognition error must be logged
ImpProvParams.LogDateParseError := True;
// Save changes
(ImpRequestDef As IMetabaseObject).Save;
End Sub UserProc;
After executing the example import object parameters are changed: empty rows are skipped on import, date recognition errors are logged, series are overwritten. Row field length is also changed in data source, and if imported value does not correspond to field consumer type, the Null value is written.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Cubes;
…
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
RubrKey: uinteger;
ImpRequestDefDescr: IMetabaseObjectDescriptor;
ImpRequestDef: IImportRequestDefinition;
ImpProvParams: IImportRequestProviderParams;
Begin
// Get repository
Mb := Params.Metabase;
// Get time series database
RubrKey := Mb.GetObjectKeyById("TSDB_IMPORT");
// Get import object
ImpRequestDefDescr := Mb.ItemByIdNamespace["OBJ_IMPORT", RubrKey];
// Get time series loading parameters
ImpRequestDef := ImpRequestDefDescr.Edit() As IImportRequestDefinition;
ImpProvParams := ImpRequestDef.ProviderParams;
// Specify that on import of values that do not correspond to consumer field type
// the Null value is written
ImpProvParams.LoadNullForMissMatchValueType := True;
// Specify that on import a series is overwritten
ImpProvParams.OverWriteWholeFactorValues := True;
// Set length of string field in data source
ImpProvParams.SourceFieldStringSize := 100;
// Specify that on import of values empty rows are skipped
ImpProvParams.SkipEmptyRows := True;
// Specify that on import time series period is not decreased
// in time series database
ImpProvParams.DecreasePeriod := False;
// Specify that date recognition error must be logged
ImpProvParams.LogDateParseError := True;
// Save changes
(ImpRequestDef As IMetabaseObject).Save();
End Sub;
See also: