IImportRequestProviderParams.TreatEmptyStringAsNull

Fore Syntax

TreatEmptyStringAsNull: Boolean;

Fore.NET Syntax

TreatEmptyStringAsNull: boolean;

Description

The TreatEmptyStringAsNull property determines whether to write empty strings as Null.

Comments

The TreatEmptyStringAsNull property is used to load data only into non-version time series databases.

Available values:

Fore Example

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;
    ImpProvParams: IImportRequestProviderParams;
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;
    ImpProvParams := ImpRequestDef.ProviderParams;
    // Specify that empty strings are written as Null
    ImpProvParams.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.

Fore.NET Example

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_NON_REV");
    // Get import object
    ImpRequestDefDescr := Mb.ItemByIdNamespace["OBJ_IMPORT", RubrKey];
    // Get time series loading parameters
    ImpRequestDef := ImpRequestDefDescr.Edit() As IImportRequestDefinition;
    ImpProvParams := ImpRequestDef.ProviderParams;
    // Specify that empty strings are written as Null
    ImpProvParams.TreatEmptyStringAsNull := True;
    // Save changes
    (ImpRequestDef As IMetabaseObject).Save();
End Sub;

See also:

ICubeMetaLoader