DB2® Data Types

The following tables show the correspondences of DB2® to LotusScript® data types.

In DB2®, the data type pairs DOUBLE and FLOAT and NUMERIC and DECIMAL are synonymous, and only the first of each type synonym (DOUBLE and NUMERIC) is indicated in these tables.

  • (p) -- Indicates that if Allow Precision Loss is not enabled, then an error will be generated on the type match. Allowing precision loss is the default.
  • (o) -- Indicates that overflow checking will be performed when data is being transferred. If an overflow occurs and Truncate Data When Necessary is enabled, then the data is truncated; if not, an error is generated.
Note: For more information on the organization of these tables, see the topic entitled "Note on Connection Data Type Conversion Tables" in a previous chapter. These tables may have changed since this printing. For information about DB2® data types, see http://www.com/software/data/db2.

Data Type Considerations

The following considerations pertain to use of DB2® data types.

  • When you use the DB2® BIGINT data type as a keyfield on a connection document, a precision loss error occurs when you initialize keys. The error also occurs if you select "Leave all/Leave selected RealTime fields in Documents" and one of the field values is a BIGINT. To avoid this error, use a different data type in these instances.
  • The DB2® data type DATALINK and the Data Links Manager are not currently supported.
  • The DB2® column used as the timestamp field in timestamp replication or timestamp polling must be of type TIMESTAMP, not DATE.
  • DB2® allows the storage of the time value 12:00:00 AM as both 00:00:00 and 24:00:00. When transferring 24:00:00 from DB2®, Domino® Enterprise Connection Services (DECS) and HCL Enterprise Integrator (HEI) consider this time to be invalid. If 12:00:00 AM times are inserted through DB2®, and not through DECS or HEI, use 00:00:00 for 12:00:00 AM, not 24:00:00.
Note: There is a limitation on how Connectors interpret a Notes® NUMBER field. When you use the "Create Target Metadata" option from an Notes® source, heavy precision loss may occur with Notes® NUMBER fields.

Execute

This table describes how the Execute method converts data types between LotusScript® Connector Extensions and DB2®.

DB2® Data Type

Attribute

Connector (LC) Data Type

BIGINT

Numeric

SMALLINT

Int

INTEGER

Int

DOUBLE

precision =15

Float

NUMERIC

prec-scale<=9, scale<=0

Int

NUMERIC

prec-scale<=19, scale<=4

Currency

NUMERIC

other

Numeric

DATE

Datetime

REAL

precision =7

Numeric

TIME

Datetime

TIMESTAMP

Datetime

CHAR

(default)

FOR BIT DATA

Text (fixed length, bound <= 32766)

Binary (BLOB format) (fixed length, bound <= 32766)

VARCHAR

(default)

FOR BIT DATA

Text (variable length, bound <= 32740)

Binary (BLOB format) (variable length, bound <= 32740)

LONG VARCHAR

(default)

FOR BIT DATA

Text (variable length, bound <= 32740)

Binary (BLOB format) (variable length, bound <= 32740)

CLOB

Text (variable length, bound <= 2GB)

GRAPHIC

Text (fixed length, bound <= 16383)

VARGRAPHIC

Text (variable length, bound <= 16383)

LONG VARGRAPHIC

Text (variable length, bound <= 32700)

DBCLOB

Text (variable length, bound <= 2GB)

BLOB

Binary (BLOB format) (variable length, bound <= 2GB)

Fetch

This table describes how the Fetch method converts data types between LotusScript® Connector Extensions and DB2®.

Connector (LC) Data Type

Attribute

DB2® Data Type

Int

INTEGER, SMALLINT, DOUBLE (p), NUMERIC (p)

Float

INTEGER, SMALLINT, DOUBLE, NUMERIC (p)

Currency

INTEGER, SMALLINT, DOUBLE (p), NUMERIC (p)

Numeric

INTEGER (p), BIGINT, SMALLINT (p), DOUBLE (p), NUMERIC (p)

Datetime

TIMESTAMP (p), DATE, TIME

Text (o)

CHAR [FOR BIT DATA], VARCHAR [FOR BIT DATA], LONG VARCHAR [FOR BIT DATA], CLOB, GRAPHIC, VARGRAPHIC, LONG VARGRAPHIC, DBCLOB, BLOB

Binary (o)

BLOB

CHAR [FOR BIT DATA], VARCHAR [FOR BIT DATA], LONG VARCHAR [FOR BIT DATA], CLOB, GRAPHIC, VARGRAPHIC, LONG VARGRAPHIC, DBCLOB, BLOB

non-BLOB

Invalid

Insert/Update

This table describes how the Insert and Update methods convert data types between LotusScript® Connector Extensions and DB2®.

Connector (LC) Data Type

Attribute

DB2® Data Type

Int

INTEGER, SMALLINT (p), DOUBLE, NUMERIC (p)

Float

INTEGER (p), SMALLINT (p), DOUBLE, NUMERIC (p)

Currency

INTEGER (p), SMALLINT (p), DOUBLE (p), NUMERIC (p)

Numeric

INTEGER (p), BIGINT, SMALLINT (p), DOUBLE (p), NUMERIC (p)

Datetime

TIMESTAMP, DATE (p), TIME (p)

Text

CHAR [FOR BIT DATA] (o), VARCHAR [FOR BIT DATA] (o), LONG VARCHAR [FOR BIT DATA] (o), CLOB (o), GRAPHIC (o), VARGRAPHIC (o), LONG VARGRAPHIC (o), DBCLOB (o), BLOB (o)

Binary

any

CHAR [FOR BIT DATA] (o), VARCHAR [FOR BIT DATA] (o), LONG VARCHAR [FOR BIT DATA] (o), CLOB (o), GRAPHIC (o), VARGRAPHIC (o), LONG VARGRAPHIC (o), DBCLOB (o), BLOB (o)

number list

INTEGER (p), BIGINT, SMALLINT (p), DOUBLE, NUMERIC (p)

datetime list

TIMESTAMP, DATE (p), TIME (p)

Create

This table describes how the Create method converts data types between LotusScript® Connector Extensions and DB2®.

Connector (LC) Data Type

Attribute

DB2® Data Type

Int

INT, SMALLINT, or NUMERIC (prec, 0)

Float

DOUBLE or NUMERIC (prec, scale)

Currency

NUMERIC (19, 4)

Numeric

NUMERIC (prec, scale), BIGINT

Datetime

TIMESTAMP, DATE, or TIME

Text

CHAR (fixed,len<=254), VARCHAR (254<len<=4000), LONG VARCHAR (4000<len<=32700), or CLOB (length > 32700)

Binary

BLOB

CHAR FOR BIT DATA (fixed,len<=254), VARCHAR FOR BIT DATA (254<len<=4000), LONG VARCHAR FOR BIT DATA (4000<len<=32700), or BLOB (length > 32700)

composite

CHAR (fixed,len<=254), VARCHAR (254<len<=4000), LONG VARCHAR (4000<len<=32700), or CLOB (length > 32700)

number list

DOUBLE

datetime list

TIMESTAMP

text list

CHAR (fixed,len<=254), VARCHAR (254<len<=4000), LONG VARCHAR (4000<len<=32700), or CLOB (length > 32700)