Field mappings files contain source-to-target field/column mappings for export and import operations. Use them whenever you need the same field mappings to be used more than once.

You can create a field mappings file in Exportizer Export window, at Field Mappings step, or manually using any text editor.

Exportizer supports two formats of field mappings files: XML (recommended) and plain text (obsolete).

XML format

This format is flexible and extendable and therefore is recommended to use whenever possible.

Such field mappings files can be created either in the Export dialog on the Field Mappings step or manually using a text editor. When creating the files manually please note that they must conform to XML standards and contain byte order marks (BOM) at the beginning if needed.

The file contains an optional common part and a series of field mappings. The common part may include some technical information like application name and version, and key fields for special cases of exporting data to databases and SQL script.

Each mapping must contain 2 parts: source and target. The source part must contain a FieldName attribute with the physical name of the source field (In Exportizer Pro and Exportizer Enterprise, dynamic expression can be used instead). The target part can have a variable number of attributes (either FieldName or FileName or both must be filled).

Example

Example of the Access-to-Oracle field mappings file in XML format:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Source-to-Target mappings for Payments aggregation -->
<FieldMappings>
  <Software>Exportizer Enterprise</Software>
  <KeyFields>PAYMENT_ID</KeyFields>
  <Items>
    <FieldMapping>
      <Source>
        <FieldName>PaymentId</FieldName>
      </Source>
      <Target>
        <FieldName>PAYMENT_ID</FieldName>
        <FieldType>INTEGER</FieldType>
        <PrimaryKey>1</PrimaryKey>
      </Target>
    </FieldMapping>
    <FieldMapping>
      <Source>
        <FieldName>Department</FieldName>
      </Source>
      <Target>
        <FieldName>DEPARTMENT</FieldName>
        <FieldType>VARCHAR2</FieldType>
        <FieldSize>20</FieldSize>
        <FieldDescription>Department Name</FieldDescription>
      </Target>
    </FieldMapping>
    <FieldMapping>
      <Source>
        <FieldName>ActualityDate</FieldName>
      </Source>
      <Target>
        <FieldName>ACTUALITY_DATE</FieldName>
        <FieldType>DATE</FieldType>
        <FieldDescription>Date of Payment</FieldDescription>
      </Target>
    </FieldMapping>
    <FieldMapping>
      <Source>
        <FieldName>PaymentSum</FieldName>
      </Source>
      <Target>
        <FieldName>PAYMENT_SUM</FieldName>
        <FieldType>NUMBER</FieldType>
        <FieldSize>12</FieldSize>
        <FieldScale>2</FieldScale>
        <FieldDescription>Payment Amount</FieldDescription>
      </Target>
    </FieldMapping>
    <FieldMapping>
      <Source>
        <!-- dynamic expressions are possible: -->
        <FieldName>vle_expr(0.1 * dataset_field_val(1, 'PaymentSum'))</FieldName>
      </Source>
      <Target>
        <FieldName>COMMISSION_SUM</FieldName>
        <FieldType>NUMBER</FieldType>
        <FieldSize>12</FieldSize>
        <FieldScale>2</FieldScale>
        <FieldDefaultValue>0</FieldDefaultValue>
        <FieldSQLSpecification>NUMBER(12, 2) DEFAULT 0</FieldSQLSpecification>
        <FieldDescription>Commission Amount</FieldDescription>
      </Target>
    </FieldMapping>
    <FieldMapping>
      <Source>
        <FieldName>Notes</FieldName>
      </Source>
      <Target>
        <FieldName>NOTES</FieldName>
        <FieldType>VARCHAR2</FieldType>
        <FieldSize>400</FieldSize>
        <FieldSQLSpecification>VARCHAR2(400)</FieldSQLSpecification>
        <FieldDescription>Notes regarding the payment</FieldDescription>
        <!-- here, the value of the unique PaymentId field is used to ensure that a unique file path is generated for each record: -->
        <FileName>vle_expr(extract_file_path(target_file_name(1)) + 'notes' + to_string(dataset_field_val(1, 'PaymentId')) + '.txt')</FileName>
      </Target>
    </FieldMapping>
  </Items>
</FieldMappings>

See the full list of available attributes.

Text format

Such files consist of series of SourceFieldName=TargetFieldName pairs, one mapping per line. It is recommended that field names not contain equal signs. In Exportizer Pro and Exportizer Enterprise, dynamic expressions can be used instead of source field names (see example below). Lines with a semicolon at the beginning are ignored as comments. Blank lines are allowed.

Such files can have any extension and can be created in any text editor. When creating the files please include byte order marks at the beginning if needed.

Example

Example of the field mappings file in text format:

;Source-to-Target mappings for Payments exporting
Department=DEPARTMENT
ActualityDate=ACTUALITY_DATE
PaymentCount=PAYMENT_COUNT
PaymentSum=PAYMENT_SUM
;dynamic expressions are possible:
vle_expr(0.1 * dataset_field_val(1, 'PaymentSum'))=COMMISSION_SUM
Target FieldName attributes, if contain characters, uncommon for field names in the target database (i.e. spaces etc.), should be enclosed in double quotes or square brackets according to the rules of the target database.