# EssDeleteDatabase

Description

EssDeleteDatabase() deletes an existing database from an application, either on the client or the server. If the database is running on the server, then it is first stopped.

Syntax

    ESS_FUNC_M EssDeleteDatabase (hCtx, AppName, DbName);

ESS_HCTX_T | hCtx
ESS_STR_T | AppName
ESS_STR_T | DbName

Parameters

hCtx | Essbase API context handle.
AppName | Name of application containing database.
DbName | Name of database to delete.

Return Value

None.

Notes

- Deleting a client database removes the local database directory and contents.
- Deleting a server database removes all objects associated with that database.

Access

For a server database, the caller must have database Create/Delete/Edit privilege (ESS_PRIV_DBCREATE).

Example

    ESS_FUNC_M
    ESS_DeleteDb (ESS_HCTX_T   hCtx)
    {
       ESS_FUNC_M     sts = ESS_STS_NOERR;
       ESS_STR_T     AppName;
       ESS_STR_T     DbName;
       AppName = "Sample";
       DbName  = "Basic";

       /* IF the current active is the same as the
        * unload db, ClearActive first */
            sts = EssClearActive(hCtx);

       /* ELSE */
            sts = EssDeleteDatabase(hCtx, AppName,
                  DbName);
       return (sts);
    }

See Also

EssDeleteApplication()
EssDeleteObject()