# EsbBuildDimension

Description

EsbBuildDimension() allows the creation of a dimension in the active database from a data file and rules file.

Syntax

    EsbBuildDimension (hCtx, pRules, pData, pUser, ErrName)

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

Parameters

hCtx | Essbase VB API context handle.
pRules | Pointer to rules file object definition structure.
pData | Pointer to data file object definition structure.
pUser | Pointer to SQL user structure (if data source is SQL database). A NULL SQL user structure indicates a non SQL data source.
ErrName | Name of the error output file to be created locally.

Return Value

None.

Notes

- If pMbrUser is not NULL, an SQL data source is assumed.
- If server Essbase VB API context is specified for the hCtx field in the rules or the data object definition structure, object must exist for the currently active application and database.
- If local Essbase VB API context is specified for the hCtx field in the rules or the data object definition structure, FileName in this structure must be a fully qualified path.
- See the description of EsbImport()for information on importing data sources.

Access

This function requires the caller to have database design privilege for the specified database (ESB_PRIV_DBDESIGN).

Example

    Declare Function EsbBuildDimension 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_BuildDimension ()
       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"

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

       '*****************
       ' Build Dimensions
       '*****************
       sts            = EsbBuildDimension (hCtx, Rules, Data, User, ErrorName)

       '***************************************************************************
       '*
       '* When a SQL data source is defined in the rules file, define
       '* the variables in the ESB_OBJDEF_T Data structure as follows:
       '*    Data.hCtx     = hCtx
       '*    Data.AppName  = ""
       '*    Data.DbName   = ""
       '*    Data.ObjType  = ESB_OBJTYPE_NONE
       '*    Data.FileName = ""
       '*
       '* Also, provide strings for the variables in the ESB_MBRUSER_T
       '* User structure; for example:
       '*    User.User     = "Dbusernm"
       '*    User.Password = "Dbpasswd"
       '*
       '* Use a blank string for User and Password, if the SQL source
       '* does not require user and password information; for example:
       '*    User.User     = ""
       '*    User.Password = ""
       '*
       '* Also, define sts as follows:
       '*    sts           =  EsbBuildDimension (hCtx, Rules, Data, User, ErrorName)
       '*
       '****************************************************************************

    End Sub

See Also

EsbImport()
EsbBuildDimFile()
EsbBuildDimStart()