ifx_getMartdef() function
The ifx_getMartdef() function retrieves the data mart definition from an accelerator and returns it as a character large object (CLOB) in XML format.
Syntax
- accelerator_name
- The name of the accelerator that contains the data mart.
- data_mart_name
- The name of the data mart.
Usage
You can store the data mart definition in a file by using the LOTOFILE() function, and then edit the XML definition. For example, you can change the data mart name, the tables or the columns, and then create a new data mart.
Return value
The ifx_getMartdef() function returns the value of the data mart definition. For example:
<?xml version="1.0" encoding="UTF-8" ?>
<dwa:martModel xmlns:dwa="http://www.ibm.com/xmlns/prod/dwa" version="1.0">
<mart name="orders_customer_mart">
<table name="customer" schema="informix" isFactTable="false" >
<column name="customer_num"/>
<column name="fname"/>
<column name="lname"/>
<column name="state"/>
</table>
<table name="orders" schema="informix" isFactTable="true" >
<column name="customer_num"/>
<column name="ship_date"/>
<column name="ship_weight"/>
</table>
<reference
referenceType="LEFTOUTER"
isRuntimeJoin="true"
parentCardinality="1"
dependentCardinality="n"
dependentTableSchema="informix"
dependentTableName="orders"
parentTableSchema="informix"
parentTableName="customer">
<parentColumn name="customer_num"/>
<dependentColumn name="customer_num"/>
</reference>
</mart>
</dwa:martModel>
Examples
This example shows how to retrieve the data mart definition from the accelerator, and then store it in a file on the client computer.
EXECUTE FUNCTION lotofile(ifx_getMartdef('MyAccelerator', 'Datamart1'),
'Datamart1.xml!','client');