Table action property

Use the Table action property to configure the connector to complete create, replace, and truncate actions on a table at run time. These actions are completed before any data is written to the table.

Usage

You can set the Table action property to the values that are listed in the following table.

Table 1. Values of the Table action property
Value Description
Append No action is completed on the table. This option is the default.
Create Create a table at run time.
Use one of these methods to specify the CREATE TABLE statement:
  • Set Generate create table statement at runtime to Yes and enter the name of the table to create in the Table name property. In this case, the connector automatically generates the CREATE TABLE statement from the column definitions on the input link. The column names in the new table match the column names on the link. The data types of columns in the new table are mapped to the column definitions on the link.
  • Set Generate create table statement at runtime to No, and enter the CREATE TABLE statement in the Create table statement property.
Replace Replace a table at run time.
Use one of these methods to specify the DROP TABLE statement:
  • Set Generate drop table statement at runtime to Yes, and enter the name of the table to drop in the Table name property.
  • Set Generate drop table statement at runtime to No, and enter the DROP TABLE statement in the Drop table statement property.
Use one of these methods to specify the CREATE TABLE statement:
  • Set Generate create table statement at runtime to Yes, and enter the name of the table to create in the Table name property.
  • Set Generate create table statement at runtime to No, and enter the CREATE TABLE statement in the Create table statement property.
Truncate Truncate a table at run time.
Use one of these methods to specify the TRUNCATE TABLE statement:
  • Set Generate truncate table statement at runtime to Yes, and enter the name of the table to truncate in the Table name property.
  • Set Generate truncate table statement at runtime to No, and enter the TRUNCATE TABLE statement in the Truncate table statement property.

To configure the job to fail when the statement that is specified by the table action fails, you can set the appropriate Fail on error property for each table action to Yes. Otherwise, when the statement fails, the connector logs a message, and the job continues.

Greenplum data types

When you use the table action property to create a table that uses Greenplum data types that are not directly supported by InfoSphere DataStage (for example, circle, polygon, XML), you must complete one of the following tasks:
  • Set the Generate create table statement at runtime property to No, and then enter an SQL statement that contains the Greenplum data types.
  • Set the Generate create table statement at runtime property to Yes. To enable the Native type attribute, on the column's page in the Greenplum Connector stage, right-click in the column area, and then click Properties. Then, select the check box for the Native type. Then, on the Columns page, specify a Greenplum data type as the value for the Native type.
Figure 1. Example of using the connector to create a circle column in the table
This figure shows an example of using the connector to create a circle column in the table.
If you have a VarChar column on your input link, the connector creates a VarChar (character varying) column of the Greenplum data type in the table. For example, if you set the Native type to circle, the connector creates a circle column in the table.
CREATE TABLE <<MyTable>>(col1 varchar(32), col2 varchar(32), col3 circle);