Creating class-level translations

Class-level translations ensure that each time a value of a certain datatype is replicated from the primary to a particular data server, the datatype of that value is changed. Sybase provides the function strings and function-string classes necessary to produce these translations.

To set up class-level translations, follow these steps:

  1. Set up and configure the replicate database gateway server.

    Refer to the Replication Server Configuration Guide for your platform for instructions.

  2. Set up the database objects and run the scripts that install the function strings and function-string classes for your primary to replicate data server connections.

    Refer to the Replication Server Configuration Guide for your platform for instructions.

  3. Create or alter the connections to specify the function-string class.

Sybase provides function-string classes for several Sybase and non-Sybase data servers:

Each of these function classes contains function strings. For example, for the DB2 database, HDS provides these translations:

With the exception of rs_db2_function_class, each function class inherits from rs_default_function_class. In general, you cannot add to, delete, or change any of these function-string classes or the functions they contain. You can modify rs_sqlserver_function_class for compatibility with earlier releases of Replication Server, but you cannot modify or alter any of its datatype translations. Although you can create classes that inherit from these classes, the classes you create cannot inherit any class-level translations from the parent class.

You are installing translations in the RSSD when you run the class-level installation scripts. If you do not run the scripts, no default class-level translations take place. Running the scripts replaces default Adaptive Server translations that would otherwise be inherited from rs_default_function_class with translations designed for a particular data server.

You activate class-level translations for a connection by specifying the function-string class when you create or alter the connection. When the function-string class is activated, all subsequent data replicated via that connection is translated according to the translations defined for that function-string class.

If a class-level translation is not specified for a published datatype (the datatype of the replicate data server), Replication Server simply translates the value from the Replication Agent to its base datatype format in the usual manner. For example:

Replication Server performs class-level translations after column-level translations and after subscription resolution, but before values are mapped to function strings. You can display a list of active function-string classes using admin show_function_classes. See “Using class-level and column-level translations together”.