Replication Server directly supports the Sybase datatypes shown in Table 2-1.
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 |
Money |
money, smallmoney |
Date/time |
datetime, smalldatetime, date, time |
Binary |
binary(n), varbinary(n), image, rawobject, rawobject in row |
Bit |
bit |
Unicode |
unichar, univarchar, unitext |
Java |
rawobject, rawobject in row |
Datatype definitions |
RCL indirectly supports these Sybase datatypes:
double precision
nchar, nvarchar
These datatypes are not supported:
The timestamp datatype
A column defined with a timestamp datatype can only be updated by Adaptive Server.
If you need to replicate data from a column that has a timestamp datatype in the primary table to a column in a replicate table, do not create the column in the replicate table with a timestamp datatype. If you do, when the replicate row is inserted, Adaptive Server generates error 272, “Can’t update timestamp through rep server.”
To replicate a timestamp from the primary table, define a column on the replicate side as varbinary(8), and do the same in the replication definition.
Another option is not to replicate the timestamp. Instead, add a column to the replicate table with a timestamp datatype, and allow Adaptive Server to fill that replicate table column when the replication occurs. Note that the column with the timestamp datatype on the replicate side will not match the timestamp on the primary side.
The optional precision argument of the float datatype
The optional precision and scale arguments of the exact decimal datatypes
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 timestamp column, define the column as binary(8) 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.