ifx_loadMart() function

The ifx_loadMart() function populates an empty data mart in an accelerator with data. The data is copied from the database tables that are referenced in the data mart definition.

Syntax


1  ifx_loadMart ( ' accelerator_name ' , ' data_mart_name ' , '
2.1 TABLE
2.1 MART
2.1 NONE
1 '
1 )
accelerator_name
The name of the accelerator that contains the data mart.
data_mart_name
The name of the data mart to load.
The locking mode
This parameter protects the data against changes during the load operation to ensure data consistency. The parameter is case-sensitive. Choose one of these values:
  • TABLE: Protects only the table that is being loaded against changes. Each table is locked in share mode while it loads with data. The loaded data is consistent within each table, but not necessarily across different tables.
  • MART: Protects all the tables that are referenced by the data mart against changes during the load operation. All the tables are locked in share mode until the data mart is loaded. The loaded data is consistent from all of the tables. All of the other user sessions are blocked from changing the data in the tables that are loading.
  • NONE: No locking. The data is read from the different tables without locking them. Other user sessions can change the data during the load operation. As a result, the loaded data might be inconsistent. Data inconsistencies might be acceptable if the purpose of the data mart is to create statistics and discover trends, rather than to find the exact values of specific data rows.

Usage

The data mart must be in the LoadPending or the Disabled state before you run the ifx_loadMart() function. You can use the ifx_getMartStat() function to determine the state of the data mart.

After a successful load, the data mart is in the Active state and it can be used for query acceleration. The ifx_loadMart() function loads the data mart tables sequentially. However, it extracts the data from a single table in parallel, if possible.

Important: To run the ifx_loadMart() function, you must be logged in as user informix or you must have been granted resource permissions. For example, to grant resource permissions to user Bob:
grant resource to Bob;

Return value

The ifx_loadMart() function returns the text string "The operation was completed successfully." or an error message.

Note: Use the SQL statement set environment use_dwa 'loadpdq <value>'; in the same database session before calling the ifx_loadMart() function to set the PDQPRIORITY for the database sessions that extract the data from the database tables. The value for parameter "loadpdq" is a positive integer between 0 and 100 (inclusive), default being 2.

Examples

This example shows how to load a data mart.

EXECUTE FUNCTION ifx_loadMart('MyAccelerator', 'Datamart1', 'MART');