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

hCtxEssbase VB API context handle.
pRulesPointer to rules file object definition structure.
pDataPointer to data file object definition structure.
pUserPointer to SQL user structure (if data source is SQL database). A NULL SQL user structure indicates a non SQL data source.
ErrNameName of the error output file to be created locally.

Return Value

None.

Notes

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()