EssCopyDatabase() copies an existing database, either on the client or the server, to a new database, including all associated databases and objects. If the database is copied on the server, the new database is started.
ESS_FUNC_M EssCopyDatabase (hCtx, hSrcCtx, SrcApp, DestApp, SrcDb, DestDb);
| ESS_HCTX_T | hCtx |
| ESS_HCTX_T | hSrcCtx |
| ESS_STR_T | SrcApp |
| ESS_STR_T | DestApp; |
| ESS_STR_T | SrcDb; |
| ESS_STR_T | DestDb |
| hCtx | Essbase API context handle. |
| hSrcCtx | Not used - should be same as hCtx. |
| SrcApp | Name of source application. |
| DestApp | Name of destination application. |
| SrcDb | Name of existing database to copy. |
| DestDb | Name of new database. |
None.
For a server database, the caller must have database Create/Delete/Edit privilege (ESS_PRIV_DBCREATE), and database designer privilege on the source database to be copied (ESS_PRIV_DBDESIGN).
ESS_FUNC_M
ESS_CopyDatabase(ESS_HCTX_T hCtx)
{
ESS_FUNC_M sts = ESS_STS_NOERR;
ESS_HCTX_T hSrcCtx;
ESS_STR_T SrcApp;
ESS_STR_T DestApp;
ESS_STR_T SrcDb;
ESS_STR_T DestDb;
hSrcCtx = hCtx;
SrcApp = "Sample";
DestApp = "NewSamp";
SrcDb = "Basic";
DestDb = "NewBasic";
sts = EssCopyDatabase(hCtx, hSrcCtx, SrcApp,
DestApp, SrcDb, DestDb);
return(sts);
}