Creates a new database within an application, either on the client or the server. If the database is created on the server, it is also started. This function can be used to create a database that supports duplicate member names.
Syntax
ESS_FUNC_M EssCreateDatabaseEx (hCtx, AppName, DbName, DbType, bNonUniqueName );
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | Essbase API context handle. |
AppName | ESS_STR_T | Name of application to contain database. |
DbName | ESS_STR_T | Name of database to create. See Database Name Limits. |
DbType | ESS_USHORT_T | Type of database to create. Can be ESS_DBTYPE_NORMAL, or ESS_DBTYPE_CURRENCY |
bNonUniqueName | ESS_BOOL_T | When set to TRUE, EssCreateDatabaseEx creates a database that has a duplicate-member-name support-enabled outline. If set to FALSE, the functionality is the same as EssCreateDatabase(). |
Notes
Creating a client database creates a directory to contain local database files.
A newly created database or application is not automatically set to active. Call EssSetActive() after calling EssCreateDatabase(), EssCreateDatabaseEx() or EssCreateApplication() to keep subsequent functions, such as EssRestructure(), from operating on the wrong database or application (the application or database that is already active).
Return Value
Returns 0 if successful; otherwise, returns an error.
Access
For a server database, the caller must have database Create/Delete/Edit privilege (ESS_PRIV_DBCREATE).
Example
ESS_FUNC_M ESS_CreateDb() { ESS_STS_T sts = ESS_STS_NOERR; ESS_STR_T AppName; ESS_STR_T DbName; AppName = "Sample"; DbName = "Basic"; sts = EssCreateDatabaseEx(hCtx, AppName, DbName, ESS_DBTYPE_NORMAL, TRUE); return (sts); }
See Also