skip to main content
Supported data types : Sybase data types
 

Try DataDirect Cloud Now

Sybase data types

The following table shows how the Sybase 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 DataDirect Cloud 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 22. Sybase data types
Sybase data type
JDBC data type
ODBC data type
BIGDATETIME 1
TIMESTAMP
SQL_DATETIME
BIGINT 2
BIGINT
SQL_BIGINT
BIGTIME 3, 4,
TIME or TIMESTAMP
SQL_DATETIME
BINARY
BINARY
SQL_BINARY
BIT
BIT
SQL_BIT
CHAR
CHAR
SQL_CHAR or SQL_WCHAR
DATE 5
DATE
SQL_TYPE_DATE
DATETIME
TIMESTAMP
SQL_TYPE_TIMESTAMP
DECIMAL
DECIMAL
SQL_DECIMAL
FLOAT
FLOAT
SQL_FLOAT
IMAGE
LONGVARBINARY
SQL_LONGVARBINARY
INT
INTEGER
SQL_INTEGER
MONEY
DECIMAL
SQL_DECIMAL
NUMERIC
NUMERIC
SQL_NUMERIC
REAL
REAL
SQL_REAL
SMALLDATETIME
TIMESTAMP
SQL_TYPE_TIMESTAMP
SMALLINT
SMALLINT
SQL_SMALLINT
SMALLMONEY
DECIMAL
SQL_DECIMAL
SYSNAME
VARCHAR
SQL_WVARCHAR or SQL_VARCHAR
TEXT
LONGVARCHAR
SQL_WLONGVARCHAR or SQL_LONGVARCHAR
TIME , 6 7, 8
TIME or TIMESTAMP
SQL_TYPE_TIME
TIMESTAMP
VARBINARY
SQL_VARBINARY
UNICHAR9
CHAR or NCHAR 10
SQL_WCHAR
UNITEXT11
LONGVARCHAR 12or LONGNVARCHAR
SQL_WLONGVARCHAR
UNIVARCHAR
VARCHAR or NVARCHAR
SQL_WVARCHAR
UNSIGNED BIGINT 13
DECIMAL
SQL_DECIMAL
UNSIGNED INT 14
BIGINT
SQL_BIGINT
UNSIGNED SMALLINT 15
INTEGER
SQL_INTEGER
VARBINARY
VARBINARY
SQL_VARBINARY
VARCHAR
VARCHAR
SQL_WVARCHAR or SQL_VARCHAR

1 Supported only for Sybase 15.5 and higher.

2 Supported only for Sybase 15.0 and higher.

3 Supported only for Sybase 15.5 and higher.

4 When FetchTWFSasTime=true, this Sybase data type is mapped to the JDBC TIME data type. When FetchTWFSasTime=false, this Sybase data type is mapped to the JDBC TIMESTAMP data type.

5 Supported only for Sybase 12.5 and higher.

6 Time mapping changes based on the setting of the Fetch TWFS as Time option.

7 When FetchTWFSasTime=true, this Sybase data type is mapped to the JDBC TIME data type. When FetchTWFSasTime=false, this Sybase data type is mapped to the JDBC TIMESTAMP data type.

8 Supported only for Sybase 12.5 and higher.

9 Supported only for Sybase 12.5 and higher.

10 When JDBCBehavior=0, the data type depends on the JVM the application uses. For JVMs earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the second value applies.

11 Supported only for Sybase 15.0 and higher.

12 When JDBCBehavior=0, the data type depends on the JVM the application uses. For JVMs earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the second value applies.

13 Supported only for Sybase 15.0 and higher.

14 Supported only for Sybase 15.0 and higher.

15 Supported only for Sybase 15.0 and higher.