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
- 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.
grant resource to Bob;
Return value
The ifx_loadMart() function returns the text string "The operation was completed successfully." or an error message.
Examples
This example shows how to load a data mart.
EXECUTE FUNCTION ifx_loadMart('MyAccelerator', 'Datamart1', 'MART');