TreatEmptyStringAsNull: Boolean;
TreatEmptyStringAsNull: boolean;
The TreatEmptyStringAsNull property determines whether to write empty strings as Null.
The TreatEmptyStringAsNull property is used to load data only into non-version time series databases.
Available values:
True. Empty strings are written as Null.
False. Default value. Empty strings are written in the initial form.
Executing the example requires that the repository contains a non-version time series database with the TSDB_NON_REV 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;
MetaLoader: ICubeMetaLoader;
Begin
// Get repository
Mb := MetabaseClass.Active;
// Get time series database
RubrKey := Mb.GetObjectKeyById("TSDB_NON_REV");
// Get import object
ImpRequestDefDescr := Mb.ItemByIdNamespace("OBJ_IMPORT", RubrKey);
// Get time series loading parameters
ImpRequestDef := ImpRequestDefDescr.Edit As IImportRequestDefinition;
MetaLoader := ImpRequestDef.ProviderParams As ICubeMetaLoader;
// Specify that empty strings are written as Null
MetaLoader.TreatEmptyStringAsNull := True;
// Save changes
(ImpRequestDef As IMetabaseObject).Save;
End Sub UserProc;
After executing the example import object parameters are changed: empty values are written as Null.
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;
MetaLoader: ICubeMetaLoader;
Begin
// Get repository
Mb := Params.Metabase;
// Get time series database
RubrKey := Mb.GetObjectKeyById("TSDB_NON_REV");
// Get import object
ImpRequestDefDescr := Mb.ItemByIdNamespace["OBJ_IMPORT", RubrKey];
// Get time series loading parameters
ImpRequestDef := ImpRequestDefDescr.Edit() As IImportRequestDefinition;
MetaLoader := ImpRequestDef.ProviderParams As ICubeMetaLoader;
// Specify that empty strings are written as Null
MetaLoader.TreatEmptyStringAsNull := True;
// Save changes
(ImpRequestDef As IMetabaseObject).Save();
End Sub;
See also: