The Generic JDBC connector uses JDBC types (java.sql.Types) for mapping Advanced SQL Engine data types to target data types. It relies on the return value of ResultSetMetaData.GetColumnType() to retrieve the data type of a target column and then maps it to QueryGrid global types.
Global Types to Generic JDBC Data Types
The Generic JDBC target connector maps JDBC data types to Global data types, which are mapped to Advanced SQL Engine data types by the initiator connector.
JDBC Data Type | Global Data Type | SQLE Data Type |
---|---|---|
BIT | G_Bit | Byteint |
BYTE, LONGVARBINARY | G_Blob | Blob |
BOOLEAN | G_Boolean | Byteint |
BIGINT | G_BigInt | Bigint |
INTEGER | G_Integer | Integer |
TINYINT, SMALLINT | G_SmallInt | Smallint |
BINARY | G_Byte | Byte |
VARBINARY | G_Varbyte | Varbyte |
CHAR, NCHAR | G_Char_UTF16 | Char |
LONGVARCHAR, CLOB, LONGNVARCHAR, NCLOB | G_Clob_UTF16 | Clob |
DATE | G_Date | Date |
DECIMAL | G_Decimal | Decimal |
REAL, FLOAT, DOUBLE | G_Double | Double precision |
NUMERIC | G_Number | Number |
TIMESTAMP | G_Timestamp | Timestamp |
TIME_WITH_TIMEZONE | G_TimestampWithTimeZone | Time with time zone |
TIME | G_Time | Time |
VARCHAR, NVARCHAR, ARRAY | G_Varchar_UTF16 | Varchar |
Generic JDBC Data Types to Global Types
When a temporary table is created on the target, the initiating Teradata connector maps Advanced SQL Engine data types to Global types, which are mapped to JDBC type by the Generic JDBC connector.
SQLE Data Type | Global Data Type | JDBC Data Type |
---|---|---|
Byteint | G_Bit | BIT |
Blob | G_Blob | BLOB |
Byteint | G_Boolean | BOOLEAN |
Bigint | G_BigInt | BIGINT |
Integer | G_Integer | INTEGER |
Smallint | G_SmallInt | SMALLINT |
Byteint | G_ByteInt | SMALLINT |
Byte | G_Byte | BINARY |
Varbyte | G_Varbyte | VARBINARY |
Char | G_Char_Latin/G_Char_UTF16 | CHAR/NCHAR |
Clob | G_Clob_Latin/G_Clob_UTF16 | CLOB/NCLOB |
Date | G_Date | DATE |
Decimal | G_Decimal | DECIMAL |
Double precision | G_Double | FLOAT |
Number | G_Number | DECIMAL |
Float | G_Float | FLOAT |
Timestamp | G_TimeStamp | TIMESTAMP |
Time with time zone | G_TimeWithTimeZone | TIME_WITH_TIMEZONE |
Timestamp with time zone | G_TimeStampWithTimeZone | TIMESTAMP_WITH_TIMEZONE |
Time | G_Time | TIME |
Varchar | G_Varchar_Latin/G_Varchar_UTF16 | VARCHAR/NVARCHAR |
When a target table contains unsupported data types, the NVP Unsupported Datatypes can be set to Cast to Varchar to convert the column with the unsupported type to varchar. This is only supported with data types that can be converted to varchar and the reverse, from varchar data type to the unsupported data type.