Import Data

The MaxL import data statement helps you load data into an Essbase database. You can import data from data files or external sources, with or without a rules file. The minimum application permission required to load data or dimensions is Database Update.

Keywords

You can import data to a database in the following ways using MaxL import data.

import database DBS-NAME data from ...

Specify whether the data import file(s) are local or on the server, and specify the type of import file(s).

Example:

import database Sample.Basic data from server data_file 'Data_Basic.txt' using server rules_file 'Data' on error write to 'sbdataload.err';

To import from multiple files in parallel, use the wildcard characters * and/or ? in the IMP-FILE name so that all intended import files are matched.

  • * substitutes any number of characters, and can be used anywhere in the pattern. For example, day*.txt matches an entire set of import files ranging from day1.txt - day9.txt.

  • ?* substitutes one occurrence of any character, and can be used anywhere in the pattern. For example, 0?-*-2011.txt matches data source files named by date, for the single-digit months (Jan to Sept).

Example:

import database Sample.Basic data from server data_file 'asdf*.txt' using server rules_file 'hjkl' on error write to 'asdf_load.err';
import database DBS-NAME using max_threads INTEGER ...

For parallel data loads, optionally specify a maximum number of threads to use.

If this clause is omitted for a parallel data load, Essbase uses a number of pipelines equal to the lesser of number of files, or half the number of CPU cores.

Example:

import database Sample.Basic using max_threads 5 data from server data_file 'asdf*.txt' on error append to 'asdf_load.err';
import database … using ... rules_file

Import data into the database using a specified load rule. A separate rule file is required for each unique, non-Essbase source of data. If you’re only re-importing data from native Essbase export files, you may not need to use a rule. If you are using a load rule for a parallel data load, all the data files must be able to use the same one.

Example:

import database Sample.Basic data from server data_file 'Data_Basic.txt' using server rules_file 'Data' on error write to 'basic_load.err';
import database … data … on error

Required. Tell Essbase what to do in case of errors during the data load: abort the operation, or write or append to a specified error log. See any Example on this page for usage.

import database ... data … from data_string

Load a single data record into the selected database. The string following data_string must be a contiguous line, without newline characters.

Example:

import database sample.basic data from data_string '"Sales" "100-10" "New York" "Jan" "Actual" 678' on error abort;
import database ... data … connect as SQL-USR ...

If you are importing from an SQL source, you must always use a rule file. Provide the appropriate user name and password:

  • If the network connectivity to the source data is saved in an Essbase connection and Datasource, provide your Essbase credentials in the MaxL statement. For example:

    import database Sample.Basic data connect as "Essbaseadmin" identified by "Essbasepa55w0RD" using server rules_file "myrulefile" on error write to 'loadds.err';
  • Otherwise, provide the user name and password required to connect to the external RDBMS source. For example:

    import database Sample.Basic data connect as "RDBMSuser" identified by "RDBMSpa55w0RD" using server rules_file "myrulefile" on error write to 'loadds.err';

Notes

  • This statement requires the database to be started.

  • When using the import statement, you must specify what should happen in case of an error.

Catalog Path Example

When the Essbase file catalog location is unspecified, the cube directory is the assumed location.

The following example performs a data load using a data file stored in the shared folder of the Essbase file catalog. The rule file is in the cube directory for Sample Basic.

import database 'Sample'.'Basic' data from server data_file 'catalog/shared/Data_Basic' using server rules_file 'Data' on error abort;