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 TERADATA_SPATIAL.

DATASET, HOST, USER_NAME, PASSWORD

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

The remaining writer-specific directives are discussed in the following sections.

DEF

Each Teradata table must be defined before it can be written.

Mapping File Syntax

The general form of a Teradata definition statement is:

TERADATA_SPATIAL_DEF <tableName>          									\
		[teradata_geometry_column <column>] 									\
		[teradata_geometry_type <type>] 									\
		[teradata_drop_table (yes|no)]								\								
		[teradata_truncate_table (yes|no)]								\								
		[<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_spatial_ 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

Optional

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 a table with the specified name exists, it will be overwritten if either the teradata_overwrite_table DEF line parameter set to YES or if the global writer keyword type teradata_out_overwrite is set to YES. Otherwise the table will be appended.

Valid values for table names include any character string devoid of SQL-offensive characters and less than 32 characters in length.

teradata_geometry_
column

This specifies the name of the column to be created that will hold the geometry when creating a new Teradata table. If this value is set to blank no geometry column will be created and an attribute only table will be written. This may invalidate other geometry related parameters.

Default: geom

teradata_geometry_type

The type of geometric entity stored within the feature. The valid values for the type are listed below:

ST_POINT

ST_GEOMETRY

Default: ST_GEOMETRY

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.

Default: NO

teradata_truncate_table

This specifies that if the table exists by this name, all the rows in the table should be deleted before any features are written to it.

Default: NO

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:

byteint

smallint

int

bigint

decimal(width, precision)

float

char(width)

varchar(width)

byte(width)

varbyte(width)

date

indexType

The type of index to create on the given field. The valid value for the index type is:

PRIKEY(primary key)

DSN

Required/Optional: Required

The ODBC Data Source Name to use for the DDL statements, i.e., create and drop tables. The DSN must exist and contain the appropriate login credentials.

Example:

TERADATA_SPATIAL_DSN teradata-dbc

Workbench Parameter

DSN

START_TRANSACTION

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

The Teradata writer does not write any features until the feature number of features are skipped, and then it begins writing the features following the specified value.

Normally, the value specified is zero – a non-zero value is usually only specified when a data load operation is being resumed after failing partway through.

Required/Optional

Optional

Mapping File Syntax

TERADATA_OUT_START_TRANSACTION 0

Workbench Parameter

Starting Feature

TRANSACTION_INTERVAL

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

Setting the transaction interval to 0 enables auto commit transaction mode. It is recommended that this number is kept high enough that the overhead of using the TPT API does not have a negative effect on performance.

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

Required/Optional

Optional

Mapping File Syntax

TERADATA_OUT_TRANSACTION_INTERVAL 20000000

Workbench Parameter

Features Per Transaction