Column-level translations affect each replicated instance of a particular column (datatype) and table. They are defined using the create replication definition or alter replication definition command.
Datatype classes are not replicated and cannot be modified. Column-level translations are implemented after subscription resolution and before class-level translations.
create replication definition replication_definition with primary at data_server.database ... (column_name [as replicate_column_name] declared_datatype [null | not null] [map to published_datatype]) ...
If the Replication Agent delivers a native Replication Server datatype, such as datetime, to the Replication Server, the declared datatype is the native datatype.
Otherwise, the declared datatype must be the datatype definition for the original datatype at the primary database.
For example, the Replication Agent delivers a value in the DB2 TIMESTAMP datatype, as a character string with delimiters, to Replication Server. In this case, the declared datatype is the datatype definition rs_db2_timestamp.
The published datatype is the datatype of the column after the column-level translation (and before a class-level translation, if any). The published datatype is normally either a Replication Server native datatype or a datatype definition for the datatype in the replicate database. If the published datatype is omitted from the replication definition, it defaults to the declared datatype.
Both declared and published datatypes have a base datatype. For example, the datatype rs_db2_timestamp has a base datatype of char(26); the native datatype char(26) also has a base datatype of char(26). A datatype definition describes a non-Sybase datatype in terms of a Replication Server native datatype. The base datatype fixes the maximum and minimum length to be associated with the datatype definition and provides defaults for other datatype attributes. The base datatype defines the delimitation of values for the datatype definition when a value of that type is delivered to Replication Server either in Log Transfer Language (LTL) or in a command executed by a Replication Server administrator such as create subscription.
create replication definition ase_employee_repdef_for_db2 with primary at ase_server.ase_database with all tables named ‘employee’ (empid int, first_name char(20), last_name char(20), ... birthdate datetime map to rs_db2_date, salary money, ...
In this example, birthdate is the column name, datetime is the declared datatype, and rs_db2_date is the published datatype. Because the declared datatype is a native datatype, the native and base datatype are the same. That is, the base datatype of datetime is datetime. The published datatype rs_db2_date is a datatype definition for DB2, and its base datatype is char(10).