Data Types

The Simba Amazon Redshift ODBC Connector supports many common data formats, converting between Redshift data types and SQL data types.

The table below lists the supported data type mappings.

Note:

If the Use Unicode option (the UseUnicode key) is enabled, then the connector returns SQL_WCHAR instead of SQL_CHAR, and SQL_WVARCHAR instead of SQL_VARCHAR.

Redshift Type SQL Type

BigInt

SQL_BIGINT

Boolean

SQL_VARCHAR

If the Show Boolean Column As String option (the BoolsAsChar key) is disabled, then SQL_BIT is returned instead.

Char

SQL_CHAR

  • If the length of the column is greater than the Max Varchar (MaxVarchar) setting, then SQL_LONGVARCHAR is returned instead.
  • If the Use Unicode option (the UseUnicode key) is enabled, then SQL_WCHAR is returned instead.
  • If the Use Unicode option (the UseUnicode key) is enabled and the column length is greater than the Max Varchar (MaxVarchar) setting, then SQL_WLONGVARCHAR is returned instead.

Date

SQL_TYPE_DATE

If you are using ODBC 2.0, the SQL type is SQL_DATE.

Decimal

SQL_NUMERIC

Double Precision

SQL_DOUBLE

GEOGRAPHY SQL_LONGVARBINARY
Geometry SQL_LONGVARBINARY

Integer

SQL_INTEGER

Real

SQL_REAL

SmallInt

SQL_SMALLINT

SUPER

SQL_LONGVARCHAR

If the Use Unicode option (the UseUnicode key) is enabled, then SQL_WLONGVARCHAR is returned instead.

Text

SQL_LONGVARCHAR

  • If the Use Unicode option (the UseUnicode key) is enabled, then SQL_WLONGVARCHAR is returned instead.
  • If the Text As LongVarChar option (the TextAsLongVarchar key) is disabled, then SQL_VARCHAR is returned instead.
  • If Use UnicodeUseUnicode is enabled and Text As LongVarCharTextAsLongVarchar is disabled at the same time, then SQL_WVARCHAR is returned instead.
TIME

SQL_TYPE_TIME

If you are using ODBC 2.0, the SQL type is SQL_TIME.

TIMETZ

SQL_TYPE_TIME

If you are using ODBC 2.0, the SQL type is SQL_TIME.

Timestamp

SQL_TYPE_TIMESTAMP

If you are using ODBC 2.0, the SQL type is SQL_TIMESTAMP.

TIMESTAMPTZ

SQL_TYPE_TIMESTAMP

If you are using ODBC 2.0, the SQL type is SQL_TIMESTAMP.

VARBYTE SQL_LONGVARBINARY

VarChar

SQL_VARCHAR

  • If the length of the column is greater than the Max Varchar (MaxVarchar) setting, then SQL_LONGVARCHAR is returned instead.
  • If the Use Unicode option (the UseUnicode key) is enabled, then SQL_WVARCHAR is returned instead.
  • If the Use Unicode option (the UseUnicode key) is enabled and the column length is greater than the Max Varchar (MaxVarchar) setting, then SQL_WLONGVARCHAR is returned instead.