DATAEXPORT

Writes data to a text file, binary file, or as direct input to a relational file using ODBC.

Syntax

For a text output file:

DATAEXPORT "File" "delimiter" "fileName" "missingChar"

For a binary output file:

DATAEXPORT "Binfile" "fileName"

Note that DATAEXPORT to binary files is not supported across Essbase releases or between 32-bit and 64-bit operating systems.

For direct export to a relational database using ODBC:

DATAEXPORT "DSN" "dsnName" "tableName" "userName" "password"
ParameterDescription

"File""Binfile""DSN"

Required keyword for the type of output file. Specify the appropriate keyword, then use the associated syntax.

"delimiter"

Required for "File" exports

The character that separates fields; for example, ","

Do not use with "Binfile" or "DSN" exports

"fileName"

Required for "File" and "Binfile" exports

Full path name for the export file.

Do not use with "DSN" exports.

"missingChar"

Optional for output type "File"

  • A text string to represent missing data values. Maximum length: 128 characters.

  • "NULL" to skip the field, resulting in consecutive delimiters (such as ,,).

  • Default value: #MI

Do not use with "Binfile" or "DSN" exports, or in combination with the SET DATAEXPORTRELATIONALFILE command.

"dsnName"

Required for output type "DSN"

The DSN name used to communicate with the SQL database. A substitution variable can be used.

Do not use with output type "File" or "Binfile."

"tableName"

Required for "DSN" exports

Name of the table where the exported data is to be inserted. The table must exist, and table and column names cannot contain spaces.

Do not use with "File" or "Binfile" exports.

"userName"

Required for "DSN" exports

The user name that is used when communicating with the database. A substitution variable can be used.

Do not use with "File" or "Binfile" exports.

"password"

Required for "DSN" exports

The password that is used when communicating with the database. A substitution variable can be used.

Do not use with "File" or "Binfile" exports.

Notes

Description

The DATAEXPORT calculation command writes data into a text or binary output file, or connects directly to an existing relational database wherein the selected exported data is inserted.

Whereas both the MaxL Export Data statement and the ESSCMD EXPORT command can export all, level 0, or input data from the entire database as text data, the DATAEXPORT calculation command also enables you to:

Using Report Writer to create an "export" file also provides extensive flexibility in selecting and formatting the data; however, using DATAEXPORT outputs the data more quickly. For information about using Report Writer to export data, see the Oracle Essbase Database Administrator's Guide.

Example

Text Output File Example 1

SET DATAEXPORTOPTIONS
  {
  DataExportLevel "LEVEL0";
  };
DATAEXPORTCOND ("Sales">=1000);
FIX ("100-10","New York","Actual","Sales");
DATAEXPORT "File" "," "b:\exports\jan.txt" "#MI";
ENDFIX;

Specifies a level 0 data export level, limits output to data only with 1000 or greater Sales, fixes the data slice, then exports to a text file located at b:\exports\jan.txt, using comma (,) delimiters and specifying #MI for missing data values.

Text Output File Example 2

SET DATAEXPORTOPTIONS 
  { 
  DataExportLevel "LEVEL0";
  DataExportRelationalFile ON; 
  };
DATAEXPORTCOND ("Sales">=1000);
FIX ("100-10","New York","Actual","Sales");
DATAEXPORT "File" "," "b:\exports\jan.txt";
ENDFIX;

Specifies the same export content as Example 1; however, the output file is formatted for input to a relational database. Notice the missingChar parameter is intentionally excluded.

Binary Example 1: Export

SET DATAEXPORTOPTIONS 
  { 
  DataExportLevel "ALL";
  };
FIX ("New York");
DATAEXPORT "BinFile" "b:\backup\newyork.bin";
ENDFIX;

Exports all New York blocks. Binary exports can be fixed only on sparse dimensions. Essbase uses the same bitmap compression technique to create the file as is used by Essbase Kernel.

Binary Example 2: Import

SET DATAIMPORTIGNORETIMESTAMP OFF;
DATAIMPORTBIN "b:\backup\newyork.bin"

Imports the previously exported file. The timestamp must match. The data is imported to the database on which the calculation script is executed. Because only data was exported, to recreate a database after using DATAIMPORT to read in the data, you must recalculate the data.

Direct Input to Relational Database Example

SET DATAEXPORTOPTIONS
  {
  DataExportLevel "ALL";
  };
FIX("100-10","New York","Actual","Sales");
 DATAEXPORT "DSN" "cur_sale" "newyork" "admin" "password";
ENDFIX;

Inserts the selected records directly to the table named newyork. By default, Essbase inserts exported data row-by-row. If the DATAEXPORTENABLEBATCHINSERT configuration setting is set to TRUE in essbase.cfg, records are batch inserted. To control the number of rows that are batch inserted at a time, use the DEXPSQLROWSIZE configuration setting in conjunction with DATAEXPORTENABLEBATCHINSERT set to TRUE.

See Also