skip to main content
OpenEdge Data Management: DataServer for ODBC
ODBC Data Source Data Types : Sybase data type equivalencies
 

Sybase data type equivalencies

The following table lists the Sybase data types, their ODBC SQL equivalents, and their default OpenEdge equivalents. The data types in parentheses are alternative data types that you can specify in the schema holder for your Sybase data source.
Table 32. Sybase data type equivalencies
Sybase data type
SQL-ODBC data type
OpenEdge default
integer
SQL_INTEGER
INTEGER (DECIMAL)
smallint
SQL_SMALLINT
INTEGER (DECIMAL or LOGICAL)
tinyint
SQL_TINYINT
INTEGER (DECIMAL or LOGICAL)
decimal
SQL_DECIMAL
DECIMAL (INTEGER)
numeric 1
SQL_DECIMAL
DECIMAL (INTEGER)
float2
SQL_FLOAT
DECIMAL (INTEGER)
double precision
SQL_DOUBLE
DECIMAL (INTEGER)
real
SQL_REAL
DECIMAL (INTEGER)
char3
SQL_CHAR
CHARACTER
varchar4
SQL_VARCHAR
CHARACTER
nchar5, 6
SQL_CHAR
CHARACTER
nvarchar7
SQL_VARCHAR
CHARACTER
text, ntext
SQL_LONGVARCHAR
CHARACTER 8
money
SQL_DECIMAL
DECIMAL (INTEGER)
smallmoney
SQL_DECIMAL
DECIMAL (INTEGER)
datetime
SQL_TIMESTAMP
CHARACTER9 (DATE)10
smalldatetime
SQL_TIMESTAMP
CHARACTER11 (DATE)12
binary
SQL_BINARY
CHARACTER
varbinary
SQL_VARBINARY
CHARACTER
image
SQL_LONGVARBINARY
CHARACTER13
bit
SQL_BIT
LOGICAL
timestamp14
SQL_VARBINARY
Unsupported
identity
NA
You can only display these values15
bigint
SQL_BIGINT
INT64 (INTEGER, DECIMAL, or LOGICAL)

1 The DataServer truncates values in Sybase decimal or numeric columns defined with a scale greater than 10. In the case of float columns, it reliably translates up to 10 places only.

2 Do not use the float or real data types in joins, in primary keys, or with the equality operator.

3 When you define a binary or char column to allow nulls, Sybase stores the data type definitions as varbinary and varchar respectively. The equivalent SQL data types that the Data Dictionary displays for these are SQL VARBINARY, SQL VARCHAR, and SQL VARCHAR. This does not affect how the DataServer maps the Sybase data types to OpenEdge data types.

4 When you define a binary or char column to allow nulls, Sybase stores the data type definitions as varbinary and varchar respectively. The equivalent SQL data types that the Data Dictionary displays for these are SQL VARBINARY, SQL VARCHAR, and SQL VARCHAR. This does not affect how the DataServer maps the Sybase data types to OpenEdge data types.

5 When you define a binary or char column to allow nulls, Sybase stores the data type definitions as varbinary and varchar respectively. The equivalent SQL data types that the Data Dictionary displays for these are SQL VARBINARY, SQL VARCHAR, and SQL VARCHAR. This does not affect how the DataServer maps the Sybase data types to OpenEdge data types.

6 You can access nchar and nvarchar data types as Sybase objects and bypass their conversion to CHARACTER by running a Sybase stored procedure or using the send–sql–statement option supported by the DataServer.

7 You can access nchar and nvarchar data types as Sybase objects and bypass their conversion to CHARACTER by running a Sybase stored procedure or using the send–sql–statement option supported by the DataServer.

8 Although the Sybase text and image fields can hold up to 2MB, OpenEdge retrieves only up to 32K. If you are using an OpenEdge Format phrase, there might be additional limits on the size of text and image fields. See the Format Phrase entry in the OpenEdge Development: ABL Reference. You can use the DataServer (-Dsrv MAX_LENGTH) startup parameter to limit the amount of returned text data.

9 By default, the initial value of a Sybase datetime or smalldatetime column is unknown ("?"). The default initial values for binary and varbinary are also unknown ("?"). The Sybase datetime and smalldatetime data types contain both date and time information. The DataServer maps these to the OpenEdge CHARACTER data type; however, you can change the CHARACTER data type to INTEGER or DATE in the schema holder. If you do this, remember to change the format to match the new data type. For example, if you change the data type to DATE, specify a date format, such as 99/99/99.

10 When you change the default mapping of Sybase datetime or smalldatetime data types to the OpenEdge DATE data type, OpenEdge truncates the time portion of the date.

11 By default, the initial value of a Sybase datetime or smalldatetime column is unknown ("?"). The default initial values for binary and varbinary are also unknown ("?"). The Sybase datetime and smalldatetime data types contain both date and time information. The DataServer maps these to the OpenEdge CHARACTER data type; however, you can change the CHARACTER data type to INTEGER or DATE in the schema holder. If you do this, remember to change the format to match the new data type. For example, if you change the data type to DATE, specify a date format, such as 99/99/99.

12 When you change the default mapping of Sybase datetime or smalldatetime data types to the OpenEdge DATE data type, OpenEdge truncates the time portion of the date.

13 Although the Sybase text and image fields can hold up to 2MB, OpenEdge retrieves only up to 32K. If you are using an OpenEdge Format phrase, there might be additional limits on the size of text and image fields. See the Format Phrase entry in the OpenEdge Development: ABL Reference. You can use the DataServer (-Dsrv MAX_LENGTH) startup parameter to limit the amount of returned text data.

14 The DataServer considers a timestamp data type to be a hidden value. It is not visible to the user, but you can still access a Sybase table that contains a timestamp column.

15 You can display values in identity columns, but you cannot insert or update them.