Writer Directives

The directives processed by the Informix Writer are listed below. The suffixes shown are prefixed by the current <WriterKeyword> in a mapping file. By default, the <WriterKeyword> for the Informix writer is INFX.

DATASET, USER_NAME, PASSWORD, BEGIN_SQL{n}, END_SQL{n}

The DATASET, USER_NAME, PASSWORD, BEGIN_SQL{n}, and END_SQL{n} directives operate in the same manner as they do for the Informix reader. The remaining writer-specific directives are discussed in the following sections.

ABORT_ON_BAD_DATA

Required/Optional: Optional

Some features may contain out-of-range or invalid attribute values. These features will be rejected and cannot be written to the database. If the value of this directive is YES then the translation will be aborted immediately after encountering such a problem. If this directive is set to NO then the translation will continue but the features with rejected feature will not be written to the database.

Values: YES | NO

Default: NO

Example:

INFX_ABORT_ON_BAD_DATA YES

Workbench Parameter: Abort Translation on Bad Data

DEF

Required/Optional: Required

Each database table must be defined before it can be written. For the Informix writer, the DEF line is specified in one of three forms. The first one is used for inserting data:

INFX_DEF <tableName> \
    [infx_overwrite_table    (YES|NO|TRUNCATE)] \
    [<fieldName>       <fieldType>] +

When the destination table does not exist, the table definition specifies the table that will be created. When the destination table exists and is not being dropped, the fields and types listed should match those of the existing table.

Fields in the table definition that do not match any existing columns will be ignored by the writer. Where <fieldType> is specified, it should be a field type supported by the target database.

If the table does not exist, or infx_overwrite_table is specified with a value of YES, then the field names and types are used to first create the table. In any case, if a <fieldType> is given, it may be any field type supported by the target database.

This example defines the SUPPLIER table for FME. If the table did not exist, it will be created just before the first SUPPLIER row is written. If the table already exists, the data will be appended to the existing table.

INFX_DEF SUPPLIER \
    ID  integer \
    NAME char(100) \
    CITY char(50) 

The following example is exactly the same, except that it replaces any existing table named SUPPLIER with a new table having the specified definition. If the table SUPPLIER does not exist in the database, then a new table is simply created.

INFX_DEF SUPPLIER \
    infx_overwrite_table YES \
    ID  integer \
    NAME char(100) \
    CITY char(50) 

The second form is used for updating data:

INFX_DEF <tableName> \
    [infx_overwrite_table    (YES|NO|TRUNCATE)] \
    [infx_update_key_columns   <columns>] \
    [<fieldName>       <fieldType>] +

The set of key columns to use (shown <columns> as above) is specified as a comma-separated list. The infx_overwrite_table parameter should always be set to YES in this mode.

The third form is used for deleting data:

INFX_DEF <tableName> \
    [infx_overwrite_table    (YES|NO|TRUNCATE)] \
    [infx_delete_key_columns   <columns>] \
    [<fieldName>       <fieldType>] +

The set of key columns to use (shown <columns> as above) is specified as a comma-separated list. The infx_overwrite_table parameter should always be set to YES in this mode.

TRANSACTION_INTERVAL

This statement informs FME about the number of features to be placed in each transaction before a transaction is committed to the database.

If the INFX_TRANSACTION_INTERVAL statement is not specified, then a value of 1000 is used as the transaction interval.

Parameter

Contents

<transaction_interval>

The number of features in a single transaction.

Default: 1000

Example:

INFX_TRANSACTION_INTERVAL 5000

Workbench Parameter: Transaction Interval