Generic Table Import XML tag reference

The table import definition is contained in a single XML document, which includes data mapping and reference directives to the specified application table. Below is the XML definition tag reference set:

Main XML document tags

<table-config>
Definition
Defines the Generic Table Import XML document.
Attributes
None
Inner Tags
<table> (required)

Table tags

<table>
Definition
Defines the table to perform the insert, update, or delete operation.
Attributes
name (required): The table name.
transaction-type (required): The type of operation for the import transaction. These transaction types are available:
  • INSERT_UPDATE: Inserts records if the specified key field is not found and updates records if the key field is found in the database.
  • UPDATE: Updates records if the specified key field is found.
  • INSERT: Inserts records with no restrictions.
  • DELETE: Deletes records if the specified key field is found in the database. This is a one-to-one delete, where each record in the CSV file is deleted in the database if the key field is found.

key-fields (optional): A comma-delimited list of fields (db-fields) that is used to determine the operation for all transaction types except INSERT (see the transaction-type attribute description).
primary-key (required): The primary key field of the application table.
Inner Tags
<fields> (required)
<deletes> (optional)
<fields>
Definition
Contains a set of fields to insert or update in the application table.
Attributes
None
Inner Tags
<field> (required)
<deletes>
Definition
Contains a set of conditional delete instructions for the application table. The tags within this element enable conditional deletes.
Attributes
None
Inner Tags
<delete> (required)
<delete>
Definition
Describes how to construct and execute a delete statement on the table.
Attributes
type (required): The occurrence type of the delete operation. These deletion types are available:
  • PRE: The deletion occurs before the processing of the records.
  • POST: The deletion occurs after the processing of the records.
  • EACH: The deletion occurs before each record is imported. This is useful when the delete statement uses field values that are derived from the imported data. In this case, when a <delete-field> element contains no default-value or <reference> element, then the value that is used is obtained from the resolved value of the imported data field.
Inner Tags
<delete-field> (required): You can have many <delete-field> elements. Each <delete-field> element performs a condition check on a particular field. The <delete-field> conditions are ANDed together to determine if the record is deleted from the database.
<delete-field>
Definition
Defines the field checking condition based on the attributes that are provided. If the collection of <delete-field> condition holds true (evaluates to TRUE), then the record is deleted.

This tag set is similar to the where statement in SQL.

Attributes
db-field (required): The field in the table on which to perform the condition checking.
condition (required): The condition operation to use on db-field. These condition values are available:
  • EQUAL: "="
  • LESS: "<"
  • LESS_EQUAL: "<="
  • GREATER: ">"
  • GREATER_EQUAL: ">="
date-format (required for date fields): Used for date db-fields to define the date format. The format of this attribute must be in the Java supported SimpleDateFormat.

For example: yyyyMMdd HHmm

default-value (optional): Used as the value to which the db-fields are compared with the specified condition (db-field=default-value, db-field<default-value, and so on). This field is required if no <reference> element is present and the delete type is not EACH. These reserved words are supported:

  • !SYSTEM_DATE: The transaction date is used as the default value.
  • !SYSTEM_DATE_TIME: The transaction date with a timestamp is used as the default value.
offset (optional): Used for date fields to specify an offset in days that is relative to the resolved date after the day directive is applied.
day (optional): Used for date fields to specify a relative day, before the given resolved date field value.

For example, if the resolved date was Friday the 9th and day=THURS, then the date to use in the condition is Thursday the 8th.

These values are allowed: SAT, SUN, MON, TUES, WED, THURS, FRI.

Inner Tags
<reference> (optional): Used to look up a value from another table to resolve the value to the key.
<field>
Definition
Specifies a field (column) in the application database table to import from the data file.
Attributes
index (required): The index of the column (field) in the data file (must be unique).
db-field (required): The name of the application database field that the value in this column corresponds to (must be unique).

db-fields that start with ! are reserved by the system. These words are the reserved words for this attribute:

!TRANSACTION_TYPE: When this word is in db-field, the word denotes that the value in this field in the import data determines what type of transaction applies to the record. If the field value is empty or not specified, the transaction-type in the <table> element is used.

Values that start with * are reserved for custom usage and are not processed by the system.

default-value (optional): The default value to use when no value is imported or resolved for the given field. These reserved words are supported for this attribute:
  • !SYSTEM_DATE: The transaction date is used as the default value.
  • !SYSTEM_DATE_TIME: The transaction date with a timestamp is used as the default value. If a <field> element has both a <reference> element and a default-value attribute defined and the supplied-value attribute is different than the db-field, the default value is resolved based on the reference.

    For example:

    <field name="F" db-field ="HTYPE_ID" default_value="REG"> 
    <reference tablename="HOUR_TYPE" supplied-value="HTYPE-NAME" 
    resolve-to-field="HTYPE_ID"/>
date-format (required for date fields): Specifies the date format for date fields. The format must be in the Java supported SimpleDateFormat.

For example: yyyyMMdd HHmm

Inner Tags
<reference> (optional)
<mapping> (optional)
<reference>
Definition
Defines a field lookup from another table to resolve the current field value.

Example 1: HTYPE_NAME is to be resolved to a HTYPE_ID from the HOUR_TYPE table:

<field name="F" db-field ="HTYPE_ID"> <reference table-name="HOUR_TYPE"
supplied-value="HTYPE-NAME" resolve-to-field="HTYPE_ID"/>

Example 2: DEPT_UDF1 is to be resolved to a DEPT_ID for JOB.JOB_VAL1:

<field name="F" db-field ="JOB_VAL1"> <reference table-name="DEPARTMENT"
supplied-value="DEPT_UDF1" resolve-to-field="DEPT_ID"/>
Attributes
table-name (required): The name of the table to perform the lookup.
supplied-value (required): The field that supplies the value for the lookup. The supplied field must exist in the specified table-name.
resolve-to-field (required): The field in the reference table to resolve. If the resolve-to-field value is not specified, then the <db-field> value is assumed.
Inner Tags
None
<mapping>
Definition
Defines a mapping of the current field value. If the <mapping> and <reference> tags are used together, then mapping is performed first before the reference lookup is performed.
Attributes
name (required): The name of the mapping definition to use. The specified value must exist in the WBINT_MAPPING table (Mapping Definition page).
Inner Tags
None