EssExport

Exports a database to an ASCII file.

Syntax

ESS_FUNC_M EssExport (hCtx, AppName, DbName, PathName,
Level, Columns);
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle.

AppName

ESS_STR_T

Name of application to export.

DbName

ESS_STR_T

Name of database to export.

PathName

ESS_STR_T

Full path name of server file to contain exported information.

Level

ESS_SHORT_T

Controls level of data to export. Should be one of:

  • ESS_DATA_ALL—Export all levels of data

  • ESS_DATA_LEVEL0—Export all data only from level zero blocks

  • ESS_DATA_INPUT—Export data only from input level blocks

Columns

ESS_SHORT_T

Controls output of data blocks in column format (for creating rules files). Use non-zero for column format, and zero for no column format.

Notes

If the data for a thread exceeds 2 GB, Essbase may divide the export data into multiple files with numbers appended to the file names.

The naming convention for additional export files is as follows: _1, _2, etc. are appended to the additional file names. If the specified output file name contains a period, the numbers are appended before the period. Otherwise, they are appended at the end of the file name.

For example, if the given file name is /home/exportfile.txt, the next additional file is /home/exportfile_1.txt. If the file name is /home/exportfile, the next additional file is /home/exportfile_1.

Return Value

None.

Access

This function requires the caller to have at least read access (ESS_PRIV_READ) to the database, and to have selected it as their active database using EssSetActive().

Example

ESS_FUNC_M
ESS_Export  (ESS_HCTX_T   hCtx)
{
   ESS_FUNC_M       sts = ESS_STS_NOERR;
   ESS_SHORT_T     isLevel;
   ESS_STR_T       AppName;
   ESS_STR_T       DbName;
   ESS_STR_T       FileName;
   ESS_PROCSTATE_T pState;
   
   isLevel  = ESS_DATA_LEVEL0;
   AppName  = "Sample";
   DbName   = "Basic";

   sts = EssExport (hCtx, appName, dbName, 
         "D:\\temp\\asofile.txt", ESS_DATA_LEVEL0, ESS_FALSE); 
   if (!sts) 
   { 
      sts = EssGetProcessState (hCtx, &pState); 
      while (!sts && (pState.State != 
              ESS_STATE_DONE)) 
        sts = EssGetProcessState (hCtx, &pState); 
   }        
  return (sts);
}

See Also

  • EssImport