Adaptive Server Data Type Equivalents

Adaptive Server exact numeric types have SAP Sybase IQ equivalents.

Adaptive Server Data Type SAP Sybase IQ Data Type Notes
int INT,BIGINT,UNSIGNED INT, UNSIGNED BIGINT, or NUMERIC SAP Sybase IQ does not allow scaled integers, such as INT(7,3). Data in the form INT(precision,scale) is converted to NUMERIC(precision,scale). This differs from SAP Sybase IQ versions earlier than 12.0, and from Adaptive Server, in which int data types can be values between -2,147,483,648 and 2,147,483,647, inclusive.

To handle larger integer values, you can use a BIGINT, an unsigned integer (UNSIGNED INT), or an UNSIGNED BIGINT data type. With UNSIGNED INT, the last bit is used as part of the value. There is no positive or negative indication; all numbers are assumed to be positive, so the value can go up to 4,294,967,295.

numeric DECIMAL or NUMERIC with appropriate precision If the precision of the SAP Sybase IQ data type you define is too small to store the Adaptive Server value, the value converts to NULL.
decimal DECIMAL or NUMERIC with appropriate precision See above.
smallint SMALLINT or NUMERIC SAP Sybase IQ SMALLINTdoes not allow precision and scale. Adaptive Server smallint(precision,scale) is converted to NUMERIC(precision,scale). See INT above.
tinyint TINYINT SAP Sybase IQ TINYINT columns do not allow precision and scale. Adaptive Server tinyint(precision,scale) is converted to NUMERIC(precision,scale). See INT above.
unsigned smallint Not supported SAP Sybase IQ does not support the Adaptive Server data type unsigned smallint, but you can insert data from an Adaptive Server database column of data type unsigned smallint using INSERT...LOCATION.

The Adaptive Server approximate data types and the SAP Sybase IQ equivalents include:

Adaptive Server Data Type SAP Sybase IQ Data Type Notes
float (precision) FLOAT (precision) IQ supports greater precision for FLOAT

HNG indexes do not allow FLOAT, REAL, or DOUBLE data.

The Adaptive Server character data types and their SAP Sybase IQ equivalents include:

Adaptive Server Data Type SAP Sybase IQ Data Type Notes
char CHAR SAP Sybase IQ and Adaptive Server character (char or CHAR) data types are the same, except SAP Sybase IQ can handle NULLs. If you want an SAP Sybase IQ CHAR column to exactly match an Adaptive Server char column, specify SAP Sybase IQ column as NOT NULL. The SAP Sybase IQ default allows NULLs. Adaptive Server char columns that allow NULLs are internally converted to varchar.
varchar VARCHAR See char notes above.
nchar Not supported SAP Sybase IQ does not support the Adaptive Server data type nchar, but you can insert data from an ASE database column of data type nchar using INSERT...LOCATION.
nvarchar Not supported SAP Sybase IQ does not support the Adaptive Server data type nvarchar, but you can insert data from an Adaptive Server database column of data type nvarchar using INSERT...LOCATION.
text Not supported SAP Sybase IQ does not support the Adaptive Server data type text, but you can insert data from an Adaptive Server database column of data type text using INSERT...LOCATION.
unichar Not supported SAP Sybase IQ does not support the Adaptive Server data type unichar, but you can insert data from an Adaptive Server database column of data type unichar using INSERT...LOCATION.
univarchar Not supported SAP Sybase IQ does not support the Adaptive Server data type univarchar, but you can insert data from an Adaptive Server database column of data type univarchar using INSERT...LOCATION.
unitext Not supported SAP Sybase IQ does not support the Adaptive Server data type unitext, but you can insert data from an Adaptive Server database column of data type unitext using INSERT...LOCATION.

The Adaptive Server money data types and the SAP Sybase IQ equivalents include:

Adaptive Server Data Type SAP Sybase IQ Data Type Notes
money NUMERIC(19,4) money data is converted implicitly to NUMERIC(19,4).
smallmoney NUMERIC(10,4)  

The Adaptive Server DATE/TIME data types and the SAP Sybase IQ equivalents include:

Adaptive Server Data Type

SAP Sybase IQ Data Type Notes
datetime TIMESTAMP, DATE, or TIME Adaptive Server datetime columns maintain date and time of day values in 4 bytes for number of days before or after base date of virtual date 0/0/0000 and 8 bytes for time of day, accurate to within one 1,000,000th of a second. SAP Sybase IQ TIMESTAMP (or DATETIME) columns maintain date and time of day values in two 4-byte integers: 4 bytes for number of days since 1/1/0 and 4 bytes for time of day, based on 24-hour clock, accurate to within one 10,000th of a second. SAP Sybase IQ automatically handles the conversion.

SAP Sybase IQ also has a separate DATE data type, a single 4-byte integer. To extract only a date from a SQL Server or Adaptive Server datetime column, you can do this with SAP Sybase IQ DATE data type. To do this, define an SAP Sybase IQ DATE column with same name as the Adaptive Server datetime column. SAP Sybase IQ automatically picks up appropriate portion of datetime value.

smalldatetime TIMESTAMP, DATETIME, or DATE or TIME Define Adaptive Server smalldatetime columns as TIMESTAMP (or DATETIME) data type in SAP Sybase IQ. SAP Sybase IQ properly handles the conversion. As with regular datetime, if you want to extract just a date from an Adaptive Server smalldatetime column, do it with the SAP Sybase IQ DATE data type.
date date You can insert data from an Adaptive Server database column of data type date using INSERT...LOCATION.
time time The SAP Sybase IQ data type is the Time of day, containing hour, minute, second, and fraction of a second. The fraction is stored to 6 decimal places. A time value requires 8 bytes of storage.

The Adaptive Server data type time is between 00:00:00:000 and 23:59:59:999. You can use either military time or 12AM for noon and 12PM for midnight. A time value must contain either a colon or the AM or PM signifier. AM or PM may be in either uppercase or lowercase. A time value requires 4 bytes of storage.

You can insert data from an Adaptive Server database column of data type time using INSERT...LOCATION.

The Adaptive Server binary data types and the SAP Sybase IQ equivalents include:

Adaptive Server Data Type SAP Sybase IQ Data Type Notes
binary BINARY SAP Sybase IQ pads trailing zeros on all BINARY columns. Always create BINARY columns with an even number of characters for length.

HNG indexes do not allow BINARY data.

varbinary VARBINARY SAP Sybase IQ does not pad or truncate trailing zeros on VARBINARY columns. Always create VARBINARY columns with an even number of characters for length.

HNG indexes do not allow VARBINARY data.

Omit columns with these unsupported Adaptive Server data types:

Also omit any custom Adaptive Server data type.

Related concepts
Unsupported Adaptive Server Data Types
Conversion Errors on Data Import