Supported Adaptive Server datatypes

The Adaptive Server interface supports the Sybase datatypes listed in Table 6-1 in DataWindow objects.

Table 6-1: Supported datatypes for Adaptive Server Enterprise

Binary

NVarChar

BigInt (15.x and later)

Real

Bit

SmallDateTime

Char (see “Column-length limits”)

SmallInt

DateTime

SmallMoney

Decimal

Text

Double precision

Timestamp

Float

TinyInt

Identity

UniChar

Image

UniText (15.x and later)

Int

UniVarChar

Money

VarBinary

NChar

VarChar

Numeric

In Adaptive Server 15.0 and later, DataWindow Designer supports unsigned as well as signed bigint, int, and smallint datatypes.

Accessing Unicode data

DataWindow Designer can connect, save, and retrieve data in both ANSI/DBCS and Unicode databases. When character data or command text is sent to the database, DataWindow Designer sends a DBCS string if the UTF8 database parameter is set to 0 (the default). If UTF8 is set to 1, DataWindow Designer sends a UTF-8 string. The database server must be configured correctly to accept UTF-8 strings. See the description of the UTF8 database parameter in the online Help for more information.

The character set used by an Adaptive Server database server applies to all databases on that server. The nchar and nvarchar datatypes can store UTF-8 data if the server character set is UTF-8. The Unicode datatypes unichar and univarchar were introduced in Adaptive Server 12.5 to support Unicode data. Columns with these datatypes can store only Unicode data. Any data saved into such a column must be converted to Unicode explicitly. This conversion must be handled by the database server or client.

In Adaptive Server 12.5.1 and later, additional support for Unicode data has been added. For more information, see the documentation for your version of Adaptive Server.

Different display values in painters

The unichar and univarchar datatypes support UTF-16 encoding, therefore each unichar or univarchar character requires two bytes of storage. The following example creates a table with one unichar column holding 10 Unicode characters:

create table unitbl (unicol unichar(10))

In the Database painter, the column displays as unichar(20)because the column requires 20 bytes of storage. This is consistent with the way the column displays in Sybase Central.

However, the mapping between the Type in the Column Specifications view in the DataWindow® painter and the column datatype of a table in the database is not one-to-one. The Type in the Column Specifications view shows the DataWindow column datatype and DataWindow column length. The column length is the number of characters, therefore an Adaptive Server unichar(20)column displays as char(10) in the Column Specifications view.

Column-length limits

Adaptive Server 12.0 and earlier have a column-length limit of 255 bytes. Adaptive Server 12.5.x and later support wider columns for Char, VarChar, Binary, and VarBinary datatypes, depending on the logical page size and the locking scheme used by the server.

In DataWindow Designer, you can use these wider columns for Char and VarChar datatypes with Adaptive Server 12.5.x when the following conditions apply:

The database must be configured to use a larger page size to take full advantage of the widest limits.

For detailed information about wide columns and configuration issues, see the Adaptive Server documentation on the Product Manuals Web site. For more information about the Release database parameter, see the online Help.