Table mappings files contain source-to-target table mappings for multi-table export and import operations. Use them whenever you need the same table mappings to be used more than once.
You can create a table mappings file in Exportizer Export window during a multi-table exporting, at the Table Mappings step, or manually using any text editor.
Exportizer supports two formats of table mappings files: XML (recommended) and plain text (obsolete).
XML format
This format is flexible and extendable and therefore is recommended to use whenever possible. Each mapping must contain the source attributes with at least TableName specified and the target attributes with variable number of attributes:
Such files can be created either in the Export dialog on the Table 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.
Source attributes
DatasetType
Specifies the source dataset type. Possible values: Table, SQLFile, SQLText. If this attribute is omitted, other source attributes are used to identify the dataset type.
DatasetTitle
Specifies the source dataset title. It is used in GUI as a caption of the corresponding Exportizer data window.
TableName
Specifies a source table name.
SQLFile
Specifies a path to file with text of the source SQL query.
SQLText
Specifies the text of a source SQL query.
Target attributes
TableName
For Database target format, it specifies a table name to export data to. For SQL target format, it specifies a table name to be used in generated SQL commands.
Target formats: Database, SQL
TableDescription
Description for target table. Currently, it can be applied to Oracle, SQL Server, and PostgreSQL databases. For Database target format, the description is applied only to table, which is created during the export operation. For SQL target format, the description is applied only with Add DDL option.
Target formats: Database, SQL
FileName
File name to export data to.
Target formats: All except Database
RecordLogFileName
File name to write the record log output to.
Target formats: All
BadRecordLogFileName
File name to write the bad record log output to.
Target formats: All
HtmlDocTitle
The text to be placed into HTML Title tag.
Target formats: HTML
HtmlTableId
The text to be placed into id attribute of HTML Table tag.
Target formats: HTML
TableTitle
The text to be placed above the table data in the target document.
Target formats: HTML, RTF, Excel (XLSX), Excel (XML based)
HtmlStepNo
Current export step.
Target formats: HTML
SheetName
The name of sheet to place the table data in.
Target formats: Excel (XLSX)
Field mappings
Optional source-to-target field mappings. If omitted, the field mappings for the table are built automatically based on fields of the source table and the target table (if it exists).
Note: Source attributes TableName, SQLFile, SQLText are mutually exclusive and cannot be used for the same table mapping at the same time. But the collection of several field mappings can contain different source dataset types.
Example
Example of the table mappings file in XML format:
<?xml version="1.0" encoding="UTF-8"?>
<-- Source-to-Target table mappings for Orders database -->
<TableMappings>
<Items>
<TableMapping>
<Source>
<TableName>customer.dbf</TableName>
</Source>
<Target>
<FileName>customer.html</FileName>
<TableTitle>Customers</TableTitle>
<HtmlDocTitle>customers</HtmlDocTitle>
<HtmlTableId>customer</HtmlTableId>
<HtmlStepNo>1</HtmlStepNo>
</Target>
<FieldMappings>
<Items>
<FieldMapping>
<Source>
<FieldName>CustId</FieldName>
</Source>
<Target>
<FieldName>Customer Id</FieldName>
</Target>
</FieldMapping>
<FieldMapping>
<Source>
<FieldName>CustName</FieldName>
</Source>
<Target>
<FieldName>Customer Name</FieldName>
</Target>
</FieldMapping>
</Items>
</FieldMappings>
</TableMapping>
<TableMapping>
<Source>
<TableName>order.dbf</TableName>
</Source>
<Target>
<FileName>order.html</FileName>
<TableTitle>Orders</TableTitle>
<HtmlDocTitle>orders</HtmlDocTitle>
<HtmlTableId>order</HtmlTableId>
<HtmlStepNo>2</HtmlStepNo>
</Target>
</TableMapping>
<TableMapping>
<Source>
<TableName>payment.dbf</TableName>
</Source>
<Target>
<FileName>payment.html</FileName>
<TableTitle>Payments</TableTitle>
<HtmlDocTitle>payments</HtmlDocTitle>
<HtmlTableId>payment</HtmlTableId>
<HtmlStepNo>3</HtmlStepNo>
</Target>
</TableMapping>
</Items>
</TableMappings>
Text format
Such files consist of series of SourceTableName = TargetTableOrFileName pairs, one mapping per line. It is recommended that table (file) names not contain equal signs. 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 table mappings file in text format:
;Source-to-Target table mappings for Orders database
Customer=Customer.htm
Order=Order.htm
Payment=Payment.htm