IBM Db2 for DataStage connector

Use the IBM Db2 for DataStage connector to read and write data to your DataStage® jobs.

Prerequisites

Create the connection. For instructions, see Connecting to a data source in DataStage and the IBM Db2 for DataStage connection.

Setting up license files

You need administrative permissions to set up license certificate files to create a IBM Db2 for DataStage connection. For more information, see Setting up license files with the IBM Db2 for DataStage connector.

Reading data from the IBM Db2 for DataStage connector

Configure the IBM Db2 for DataStage connector as a source to read data from the database table.

  1. On the job design canvas, double-click the IBM Db2 for DataStage connector icon.
  2. In the Output tab, define one of the following methods of the SELECT statement:
    • If you select Generate SQL, enter the name of the table in the Table name property. Use the syntax schema_name.table_name, where schema_name is the owner of the table. If you do not specify schema_name, the connector uses the schema that belongs to the currently connected user. The connector automatically generates and runs the SELECT * FROM schema_name.table_name statement.
    • If you select Select SQL statement, specify the SELECT statement in the Select statement property.
  3. Select Enable quoted identifiers to retain the case of all object names in DDL and DML statements.
  4. If you want to read partitioned data, specify values for the Enable partitioned reads property:
    • If you choose the Db2 connector or Minimum and maximum range method, specify the name of the table that the partitioned read method uses to define the subsets of data. Each node reads the data from the source table.
    • If you choose the Modulus or Minimum and maximum range method, specify the name of the column that the partitioned read method uses to define the subsets of data.
  5. In the Before/After SQL property, specify whether an SQL statement runs before or after data processing.
  6. Click Save.

For information on partitioning data for the IBM Db2 for DataStage connector, see Partitioning and collecting data in DataStage.

Writing data to the IBM Db2 for DataStage connector

Configure the IBM Db2 for DataStage connector as a target to write data to the database table.

  1. On the job design canvas, double-click the IBM Db2 for DataStage connector icon.
  2. On the Input tab, specify the Write mode property.
  3. If the Generate SQL property is set to Yes, you must specify the Table name field.
  4. In the Enable quoted identifiers field, select Yes to retain the case of all object names in DDL and DML statements.
  5. In the Load control section, select Lode mode to specify how to load the data:
    Insert
    Appends new data to the table without changing the existing data in the table.
    Replace
    Deletes all the data from the table before loading the new data.
    Restart
    Restarts the load operation following the interruption of the previous load operation.
    Terminate
    Ends the load operation that was previously interrupted.
  6. In the Before or After SQL field, specify whether an SQL statement runs before or after data processing. For example, you can delete rows before processing the data, or insert row after processing.
  7. Select an Isolation level property to control what kinds of concurrent changes from other transactions your job can see. See Isolation levels for more information.
  8. Click Save.

Configuring bulk loading of data

Use the bulk loading method to move large quantities of data into new or existing database tables. The bulk load operation can handle most data types, including large objects (LOBs) and user-defined types (UDTs).

Configuring the bulk loading:
  1. On the job design canvas, double-click the IBM Db2 for DataStage connector icon.
  2. On the Input tab in the Write mode property, select Bulk load.
  3. In the Table name property, specify the name of the table into which you want to load the data. If the schema name is different from the value that is specified for the username, use a full table name in the format schema.name.
  4. Specify values for the bulk load properties.
  5. In the Load control section, select Lode mode to specify how to load the data:
    Insert
    Appends new data to the table without changing the existing data in the table.
    Replace
    Deletes all the data from the table before loading the new data.
    Restart
    Restarts the load operation following the interruption of the previous load operation.
    Terminate
    Ends the load operation that was previously interrupted.
  6. Select the Load method to specify how to provide the data to the target table in the database:
    Named Pipe(s)
    The connector delivers the data directly to the loader.
    Sequential File(s)
    The connector stores data to a file from which the loader loads it to the database.
  7. For loads that write to a Db2® partitioned database, select Partitioned database configuration. Specify values for the partitioned database properties.
  8. Click Save.