skip to main content
Querying data stores with SQL : Supported data types : MySQL data types
  

Try Now

MySQL data types

The following table shows how the MySQL data types are mapped to the standard data types for ODBC and JDBC.
Note: When the EnableWCharSupport connection parameter is set to true for the Hybrid Data Pipeline Driver for ODBC, character types are mapped to the corresponding ODBC W-Types. For example, the varchar(max) type is mapped to the Unicode type SQL_WLONGVARCHAR.
Table 160. MySQL Server data types
MySQL data type
JDBC data type
ODBC data type
BIGINT
BIGINT
SQL_BIGINT
BIGINT UNSIGNED
BIGINT
SQL_BIGINT
BINARY
BINARY
SQL_BINARY
BIT
BIT
SQL_BINARY
BLOB
LONGVARBINARY
SQL_LONGVARBINARY
CHAR
CHAR
SQL_CHAR or SQL_WCHAR
DATE
DATE
SQL_TYPE_DATE
DATETIME
TIMESTAMP
SQL_TYPE_TIMESTAMP
DECIMAL
DECIMAL
SQL_DECIMAL
DECIMAL UNSIGNED
DECIMAL
SQL_DECIMAL
DOUBLE
DOUBLE
SQL_DOUBLE
DOUBLE UNSIGNED
DOUBLE
SQL_DOUBLE
FLOAT
REAL
SQL_REAL
FLOAT UNSIGNED
REAL
SQL_REAL
INTEGER
INTEGER
SQL_INTEGER
INTEGER UNSIGNED
INTEGER
SQL_INTEGER
LONGBLOB
LONGVARBINARY
SQL_LONGVARBINARY
LONGTEXT
LONGVARCHAR
SQL_LONGVARCHAR or SQL_WLONGVARCHAR
MEDIUMBLOB
LONGVARBINARY
SQL_LONGVARBINARY
MEDIUMINT
INTEGER
SQL_INTEGER
MEDIUMINT UNSIGNED
INTEGER
SQL_INTEGER
MEDIUMTEXT
LONGVARCHAR
SQL_LONGVARCHAR or SQL_WLONGVARCHAR
SMALLINT
SMALLINT
SQL_SMALLINT
SMALLINT UNSIGNED
SMALLINT
SQL_SMALLINT
TEXT
LONGVARCHAR
SQL_LONGVARCHAR or SQL_WLONGVARCHAR
TIME
TIME
SQL_TYPE_TIME
TIMESTAMP
TIMESTAMP
SQL_TYPE_TIMESTAMP
TINYBLOB
LONGVARBINARY
SQL_LONGVARBINARY
TINYINT
TINYINT
SQL_TINYINT
TINYINT UNSIGNED
TINYINT
SQL_TINYINT
TINYTEXT
LONGVARCHAR
SQL_LONGVARCHAR or SQL_WLONGVARCHAR
VARBINARY
VARBINARY
SQL_VARBINARY
VARCHAR
VARCHAR
SQL_VARCHAR or SQL_WVARCHAR
YEAR
LONGVARCHAR
SQL_SMALLINT