Writer Directives

The directives that are processed by the Teradata Spatial writer are listed below. The suffixes shown are prefixed by the current <WriterKeyword>_ in a mapping file. By default, the <WriterKeyword> for the Teradata Spatial writer is COM.SAFE.FME.TERADATA_SPATIAL.

DATASET/DATABASE, HOST, PORT, USER_NAME, PASSWORD, QUERY_TIMEOUT

These directives operate in the same manner as they do for the Teradata Spatial reader.

DEF

Each Teradata table must be defined before it can be written. The general form of an Teradata definition statement is:

<WriterKeyword>_DEF <tableName> \
     [teradata_mode (insert|update|delete|inherit_from_writer)] \
     [teradata_geometry_column <column>] \
     [teradata_drop_table (yes|no)] \
     [teradata_truncate_table (yes|no)] \
     [teradata_sql_key_columns <col1>[,<col2>[,…]]] \
 [<fieldName> <fieldType>][,<indexType>]*

The table definition allows control of the table that will be created. If the table already exists, the majority of the teradata_ parameters will be ignored and need not be given. If the fields and types are listed, they must match those in the database.

If the table does not exist, 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.

Required/Optional

Required

Configuration Parameters

The configuration parameters present on the definition line are described in the following table:

Parameter

Contents

tableName

The name of the table to be written. If teradata_drop_table is set to YES, the table will be dropped and recreated before data is written. If teradata_truncate_table is set to YES the data in the table will be purged before data is written. Otherwise data will be appended. Valid values for table names include any character string devoid of SQL-offensive characters and less than 30 characters in length.

teradata_mode

The default operation mode of the feature type in terms of the types of SQL statements sent to the database.

Valid values are INSERT, UPDATE, DELETE and INHERIT_FROM_WRITER.

Note that INSERT mode allows for only INSERT operations, whereas UPDATE and DELETE can be overwritten at the feature level. INHERIT_FROM_WRITER indicates this value will be taken from the writer.

Default: INHERIT_FROM_WRITER

teradata_geometry_column

This specifies the name of the column to be created that will hold the spatial data when creating a new Ingres table.

Default: geom

teradata_drop_table This specifies that if the table exists by this name, it should be dropped and recreated before any features are written to it.
teradata_truncate_table This specifies that if the table exists by this name, it should be truncated before any features are written to it.
teradata_sql_key_columns

This is a comma-separated list of the columns that make up the key when the writer mode is either UPDATE or INSERT.

fieldName

The name of the field to be written. Valid values for field name include any character string devoid of SQL-offensive characters and less than 30 characters in length.

fieldType

The type of a column in a table. The valid values for the field type are listed below:

smallint

byteint

int

bigint

float

char(width)

varchar(width)

byte(width)

varbyte(width)

decimal(width,decimal)

date

clob(width)

blob(width)

START_TRANSACTION

This statement tells the Teradata Spatial writer module when to start actually writing features into the database.

The Teradata Spatial writer does not write any features until the feature number of features are skipped, and then it begins writing the following features. Normally, the value specified is zero – a non-zero value is only specified when a data load operation is being resumed after failing partway through.

Required/Optional

Optional

Mapping File Syntax

<WriterKeyword>_OUT_START_TRANSACTION 0

Workbench Parameter

Starting Feature

TRANSACTION_INTERVAL

This directive determines the number of features that FME will place in each transaction before a transaction is committed to the database.

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

Required/Optional

Optional

Mapping File Syntax

<WriterKeyword>_OUT_TRANSACTION_INTERVAL 2000

Workbench Parameter: Features Per Transaction

WRITER_MODE

This directive informs the Teradata Spatial writer which SQL operations will be performed by default by this writer.

This operation can be set to INSERT, UPDATE or DELETE. The default writer-level value for this operation can be overwritten at the feature type or table level. The corresponding feature type DEF parameter name is called TERADATA_MODE. It has the same valid options as the writer-level mode, as well as the value INHERIT_FROM_WRITER (which causes the writer-level mode to be inherited by the feature type as the default for features contained in that table).

This operation can also be set for individual features, using the fme_db_operation attribute. Note that when WRITER_MODE is set to INSERT, all features are inserted unless otherwise set for UPDATE or DELETE.

Required/Optional

Optional

Mapping File Syntax

<WriterKeyword>_WRITER_MODE INSERT

If this directive is not specified, then a value of INSERT is given.

Workbench Parameter

Writer Mode

Note: For more information on this directive, see the Database Writer Mode.

GEOMETRY_COLUMN_NAME

The default value of shape indicates that we want to create a spatial column with the name “shape” on the destination tables by default. This value can also be set specifically for individual feature types.

Note: This directive only applies at generation time.