## EssPartitionNewDefFile

Description

Creates and opens a new shared-partition definition file based upon input parameters supplied.

Syntax

ESS_FUNC_M EssPartitionNewDefFile (hCtx, pszFileName, pHostDatabase, piFileHandle, ppDdbCtx);

ESS_HCTX_T | hCtx;
ESS_STR_T | pszFileName;
ESS_PPART_CONNECT_INFO_T | pHostDatabase;
ESS_PINT_T | piFileHandle;
ESS_PPPART_T | ppDdbCtx;

Parameters

hCtx | Essbase API network context.
pszFileName | Name of file to be created (full path).
pHostDatabase | Identifies the host database.
piFileHandle | Handle to created file.
ppDdbCtx | An initialized distributed context.

Return Value

Returns zero if successful; error code if unsuccessful.

Example

    ESS_STS_T ESS_PartitionNewDefFile(ESS_HCTX_T hCtx)
    {

       ESS_STS_T     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 = "d:\\essbase5\\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

Constant and Structure Definitions for Partitions
EssPartitionApplyOtlChangeFile()
EssPartitionApplyOtlChangeRecs()
EssPartitionCloseDefFile()
EssPartitionFreeDefCtx()
EssPartitionFreeOtlChanges()
EssPartitionGetAreaCellCount()
EssPartitionGetList()
EssPartitionGetOtlChanges()
EssPartitionGetReplCells()
EssPartitionOpenDefFile()
EssPartitionPurgeOtlChangeFile()
EssPartitionPutReplCells()
EssPartitionReadDefFile()
EssPartitionReadOtlChangeFile()
EssPartitionReplaceDefFile()
EssPartitionResetOtlChangeTime()
EssPartitionValidateDefinition()
EssPartitionValidateLocal()
EssPartitionWriteDefFile()