# EsbBuildDimFile

Description

EsbBuildDimFile() builds a data file used to add or remove members from the active database outline. See EsbBuildDimension() for more information.

Syntax

    EsbBuildDimFile (hCtx, RulesObj, DataObj, MbrUser,
    ErrorName, fOverwriteErrorFile)

    ByVal hCtx             As Long
          pRules           As ESB_OBJDEF_T
          pData            As ESB_OBJDEF_T
          pUser            As ESB_MBRUSER_T
    ByVal ErrName          As String
    ByVal ErrFileOverwrite As Integer

Parameters

hCtx | Essbase API context handle.
RulesObj | Pointer to rules file object definition structure.
DataObj | Pointer to data file object definition structure.
MbrUser | SQL user structure (if data source is SQL database). NULL structure indicates a non-SQL data source.
ErrorName | Name of error output file on client.
fOverwriteErrorFile | A Boolean value which determines whether this function overwrites an existing file of name ErrorFile.

Return Value

Returns zero (o) if successful.

Notes

- If MbrUser is not NULL, an SQL data source is assumed.
- The description of EsbImport() provides information on importing data sources.
- The database must be the active database. See the description of EsbSetActive().
- EsbBuildDimStart() must be called prior to using EsbBuildDimFile().
- EsbBuildDimFile() can be called repeatedly prior to restructuring to add members via multiple rules and/or data file to the outline.
- The database must be restructured after completion of call(s) to EsbBuildDimFile().
- The outline must be unlocked after restructuring.

Access

This function requires database design privilege ESB_PRIV_DBDESIGN for the specified database.

Example

    Declare Function EsbBuild   Dimension Lib "ESBAPIW" (ByVal hCtx As Long, Rules As ESB_OBJDEF_T, Data As ESB_OBJDEF_T, User As ESB_MBRUSER_T, ByVal ErrName As String) As Long
    Sub ESB_BuildDimFile()
       Dim sts As Long
       Dim Rules As ESB_OBJDEF_T
       Dim Data As ESB_OBJDEF_T
       Dim User As ESB_MBRUSER_T
       Dim ErrorName As String

       '*********************************
       ' Rules file resides at the server
       '*********************************
       Rules.hCtx = hCtx
       Rules.Type = ESB_OBJTYPE_RULES
       Rules.FileName = "Test"

       '********************************
       ' Data file resides at the server
       '********************************
       Data.hCtx = hCtx
       Data.Type = ESB_OBJTYPE_TEXT
       Data.FileName = "Data"
       '**********************************
       ' For a non SQL data source provide
       ' empty strings in User structure
       '**********************************
       User.User = ""
       User.Password = ""

       '********************************
       ' Specify file to redirect errors
       ' to if any
       '********************************
       ErrorName = "BUILDDIM.ERR"

       '*****************
       ' Build Dimensions
       '*****************

       sts = EsbBuildDimFile (hCtx, Rules, Data, User, ErrorName)
    End Sub

See Also

EsbImport()
EsbBuildDimension()
EsbBuildDimStart()
EsbOtlRestructure()
EsbUnlockObject()