EsbBuildDimension() allows the creation of a dimension in the active database from a data file and rules file.
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
| 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. |
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
EsbImport()