Chapter 2: Topics


Datatypes

Replication Server directly supports the Sybase datatypes shown in Table 2-1.

Table 2-1: Replication Server-supported datatypes

Datatype class

Datatypes

Exact numeric (integer)

bigint, int, smallint, tinyint, unsigned bigint, unsigned int, unsigned smallint, unsigned tinyint, rs_address

Exact numeric (decimal)

decimal, numeric, identity

Approximate numeric (floating point)

float, real

Character

char(n), varchar(n), text, opaque

Money

money, smallmoney

Date/time

datetime, smalldatetime, date, time, timestamp

Binary

binary(n), varbinary(n), image, rawobject, rawobject in row

Bit

bit

Unicode

unichar, univarchar, unitext

Java

rawobject, rawobject in row

Datatype definitions

See “Datatype definitions”.

RCL indirectly supports these Sybase datatypes:

These datatypes are not supported:

Data in columns with unsupported datatypes can be replicated if you create the replication definition using one of the supported datatypes shown in Table 2-1. For example, to replicate a double precision column, define the column as float in the replication definition. To replicate a column with a user-defined datatype, use the underlying datatype in the replication definition.

To replicate data stored in columns of type nchar or nvarchar in the Adaptive Server, use the char and varchar Replication Server datatypes, respectively. The only difference is that the length units in nchar and nvarchar refer to the number of characters in the native character set of the Adaptive Server, and the length units in char and varchar always refer to bytes.

To get the length of the corresponding Replication Server char and varchar datatypes, multiply the declared length of the nchar or nvarchar datatype by the value of the Adaptive Server global variable @@ncharsize.

For example, if @@ncharsize is 1 (true for all single-byte character sets like iso_1, cp850, cp437, roman8, and mac), there is a one-to-one correspondence and the declared lengths are the same. If @@ncharsize is 2 (true for some multibyte character sets like Shift-JIS and EUC-JIS), multiply the declared length of the nchar and nvarchar datatypes by 2 and declare them as char and varchar in the replication definition.

The following sections describe the supported datatypes. For more information about Adaptive Server datatypes, see the Adaptive Server Enterprise Reference Manual.