User Guide > Map Connectors > Source and Target Map Connectors > IBM DB2 11.5 Universal Database
Was this helpful?
IBM DB2 11.5 Universal Database
IBM DB2 11.5 Universal Database is a source or target connector that connects directly to an IBM DB2 11.5 database, or connects with an ODBC 3.5 driver. Version 11.5.5 is supported.
See Also
Connectivity Pointers
Make sure the IBM DB2 11.5 client driver is installed and configured properly on your workstation.
IBM provides libdb2o.so driver when SQLLEN is 64 bits. SQLLEN provides the length of data in bytes depending on the data type.
If possible, create query statements using the source database application, so that syntax and validity can be checked by the native application. You can then copy the query statement and paste it in the Query statement box.
Connector Parts
Connector parts are the fields you configure to connect with a data source or target.
The settings that are available depend on the connector you select.
For a list of all parts for source connectors, see Specifying Connector, Parts, and Properties.
For a list of all parts for target connectors, see Specifying Connector, Parts, and Properties.
Property Options
You can specify the following source (S) and target (T) properties:
Property
S/T
Description
Encoding
S/T
Type of encoding to use with source and target files.
Default value is OEM.
WhereStmt
S
Provides a mechanism for advanced users to construct the Where clause of the SQL query to filter the incoming records. There is no default value for this property.
Note:  This property is not applicable when the source connection is a query statement or file. This property enables data filtering when you select a table.
SystemTables
S/T
When set to TRUE, this property allows you to see all tables that were created by the DBA. That is, the system table names appear in the table list. Default value is FALSE.
Note:  This property is applicable only if the user is logged onto the database as a DBA. Only the DBA has access to system tables.
Views
S/T
When set to TRUE, this property lists all the view names along with the table names. Default value is TRUE.
Note:  This property supports only Append and DeleteAndAppend output modes and does not support the Replace output mode.
CursorType
S
Specifies the type of cursor to use for retrieving records from the source table. The available options are:
dynamic
static
forward only (default)
For more details, see Cursors.
DriverCompletion
S/T
Controls how the ODBC driver prompts for missing information.
The available options are:
prompt - asks the user all information.
complete (default) - asks the user for information they forgot to enter.
complete required - asks the user only for information required to complete the connection.
no prompt - does not asks the user for any information.
IdentifierQuotes
S/T
All databases have what are called quoted identifiers. You enclose identifiers in quotes to make the SQL statement parseable and to distinguish between columns and character data. For example, Oracle uses double quotes (") for column and table names and single quotes (') for character data. In a SQL statement, you should enclose identifiers containing special characters or match keywords in identifier quote characters; (also known as delimited identifiers in SQL-92).
For example, the Accounts Receivable identifier is in quotes in the following SELECT statement:
SELECT * FROM "Accounts Receivable"
If you do not use identifier quotes, the parser assumes there are two tables, Accounts and Receivable and return a syntax error that they are not separated by a comma.
The available options are:
Default
"
ModifyDriverOptions
S/T
Allows you to store the ODBC driver connection information.
The available options are:
TRUE (default) - Store the ODBC connection information.
FALSE - Prompt for connection information each time the transformation is run.
DriverOptions
S/T
Specify valid ODBC driver string connection options. There is no default value for this property.
MaxDataLength
S/T
Specifies the maximum data length for long data types.
The default value is 1 MB. You can reset this number based on your available memory and target requirements.
When this connector requests the column field size for these data types, it checks for a returned value greater than the MaxDataLength value. If the value is greater, the MaxDataLength value is used.
Some ODBC drivers have maximum data length limitations. If you choose an ODBC source or target connector and the default setting is not 1 MB, the integration platform sets the value for that particular ODBC driver. Under those conditions, do not set the MaxDataLength property to a higher value.
TransactionIsolation
S/T
Allows you to specify an isolation level to use when reading from or writing to a database table with ODBC.
The ANSI SQL 2 standard defines three specific ways in which serializability of a transaction may be violated: P1 (Dirty Read), P2 (Nonrepeatable Read), and P3 (Phantoms).
The available options are:
read uncommitted – Permits P1, P2, and P3.
read committed – Permits P2 and P3. Does not permit P1.
repeatable read – Permits P3. Does not permit P1 and P2.
serializable (default) – Does not permit P1, P2 or P3.
For further details about TransactionIsolation levels, refer to IBM DB2 Universal Database ODBC documentation.
ConstraintDDL
T
Allows to specify Data Definition Language (DDL) statements to set table constraints after they are created. This is similar to support provided for SQL pass-through in the SQL import connectors. Each line must be a valid ODBC DDL statement. This property has no default. For an example, see ConstraintDDL Example.
CommitFrequency
T
Allows users to specify the number of records to insert or update before issuing a commit to the database.
This property is applicable only if the AutoCommit property is set to FALSE.
The default value is zero that is, the data is committed at the end of the transformation, allowing rollback on error. This is the slowest setting. When performing large transformations, this is not practical as it may produce too many transaction log entries.
AutoCommit
T
When set to TRUE, it automatically commits changes as they are made by each SQL statement, instead of waiting until the end of the transaction.
Also, if this option is set to TRUE, you cannot roll back changes after they are done. It will overwrite the CommitFrequency value, which means that the changes are committed by each SQL statement irrespective of the value set for CommitFrequency.
The default value is FALSE.
BulkOperations
T
Specifies whether or not to use bulk operations for faster insert. If set to TRUE, an insert statement or bulk add is executed for each record. This allows you to maximize speed. The default value is FALSE, the slower setting.
PrimaryKey
T
Allows to specify a list of comma separated field names that are used to create a primary key. If this property contains one or more field names, these names are included in the SQL CREATE statement when the connector is in replace mode. This property has no default.
To use this property, your ODBC driver must support integrity enhancement facility (IEF). Only the more advanced ODBC drivers support this.
ArraySize
T
Determines the number of rows to be sent to the server at one time. The default value is 1000, meaning each row is individually sent to the server. Larger values will buffer multiple rows and send them all at once. While this improves the speed, it affects error reporting (a server error won't be detected/reported until the next batch of records is sent to the server).
The maximum value allowed for this property is 100000. While the connector allows the value to be set that high, many drivers have lower limits. The connector will log a message indicating if the driver is forcing a lower value for the array size. In addition, the connector does not support arrays when there is a LOB-type field in the table, or when the (maximum) length of a character-type field is longer than 32767 characters. In these cases, a message will be logged indicating the array size has been reduced to 1.
Due to the way the connector attempts to support older drivers, the array support requires BulkOperations and UseCursors is set to TRUE or both must be set to FALSE. If BulkOperations is FALSE and UseCursors is TRUE, then the array size is ignored and a message is logged indicating this condition.
ConstraintDDL Example
In these example statements, we create two indices on the table called "mytable". The first index does not allow duplicates and the index values are stored in ascending order. The second index is a compound index on fields Field2 and Field3.
CREATE UNIQUE INDEX index1 ON mytable (Field1 ASC)
CREATE INDEX index2 ON mytable (Field2, Field3)
ConstraintDDL is executed only if replace mode is used for the target. If there are errors, the errors are written to the error and event log file. An error during transformation brings up the transformation error dialog box. To ignore DDL errors, you may continue the transformation.
ConstraintDDL also supports an escaping mechanism to specify DDL in the native SQL of the DBMS. Any statement preceded by an "@" is sent to the DBMS.
The following is a DDL statement for creating a primary key for the table mytable.
@CREATE INDEX pk_mytable ON mytable (Field1, Field2) WITH PRIMARY
Some ODBC drivers do not support the SQL extensions needed to create a primary key with the ODBC variant of the SQL CREATE statement. To create a primary key in these cases, use native SQL.
Supported Data Types
The following data types are supported:
bigint
binary
blob
boolean
char
clob
date
dbclob
decfloat
decimal
double
float
graphic
integer
numeric
real
smallint
time
timestamp
varbinary
varchar
vargraphic
xml
Note:  Column sizes for text-type fields (char, varchar, etc.) should be specified in bytes, not characters. This is important when sending Unicode that contains characters outside the regular ASCII range. The strings are encoded using UTF-8, and the column width needs to be specified as the (max) number of bytes that will occur in the UTF-8 string.
Last modified date: 02/09/2024