Creates and opens a new shared-partition definition file based upon input parameters supplied.
Syntax
ESS_FUNC_M EssPartitionNewDefFile (hCtx, pszFileName, pHostDatabase, piFileHandle, ppDdbCtx);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API network context. |
pszFileName | ESS_STR_T | Name of file to be created (full path). |
pHostDatabase | ESS_PART_CONNECT_INFO_T | Identifies the host database. |
piFileHandle | ESS_PINT_T | Handle to created file. |
ppDdbCtx | ESS_PART_T | An initialized distributed context. |
Return Value
Returns zero if successful; error code if unsuccessful.
Example
ESS_FUNC_M ESS_PartitionNewDefFile(ESS_HCTX_T hCtx) { ESS_FUNC_M sts = 0; ESS_INT_T iFileHandle; ESS_STR_T pszFileName; ESS_PART_T *pDdbCtx; ESS_STR_T hostname, appname, dbname; ESS_PART_CONNECT_INFO_T HostDatabase; pszFileName = "C:\\Hyperion\\products\\Essbase\\EssbaseServer\\app\\app1\\trg1\\trg1.ddb"; hostname = "local"; appname = "app1"; dbname = "dbname"; HostDatabase.pszHostName = hostname; HostDatabase.pszAppName = appname; HostDatabase.pszDbName = dbname; sts = EssPartitionNewDefFile(hCtx,pszFileName,&HostDatabase,&iFileHandle,&pDdbCtx); printf("EssPartitionNewDefFile sts: %ld\n",sts); if (!sts) { /* ... ... process definition file information ... */ sts = EssPartitionWriteDefFile(hCtx,iFileHandle,pDdbCtx); printf("\tEssPartitionWriteDefFile sts: %ld\n",sts); sts = EssPartitionCloseDefFile(hCtx,iFileHandle); printf("\tEssPartitionCloseDefFile sts: %ld\n",sts); sts = EssPartitionFreeDefCtx(hCtx,pDdbCtx); printf("\tEssPartitionFreeDefCtx sts: %ld\n",sts); } return (sts); }
See Also