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:
Set up and configure the replicate database gateway server.
Refer to the Replication Server Configuration Guide for your platform for instructions.
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.
Create or alter the connections to specify the function-string class.
If you are creating a new connection, Sybase provides a sample script that you can use to create the connection and specify the appropriate function-string class. You will need to modify the script for your installation.
Refer to the Replication Server Configuration Guide for your platform for instructions.
If you are adding class-level translations to an existing connection, use the alter connection command as described in “Adding class-level translations to an existing connection”.
Sybase provides function-string classes for several Sybase and non-Sybase data servers:
Adaptive Server Enterprise – rs_sqlserver_function_class
DB2 – rs_db2_function_class
Informix – rs_informix_function_class
Microsoft SQL Server – rs_msss_function_class
Oracle – rs_oracle_function_class
UDB – rs_udb_function_class
Each of these function classes contains function strings. For example, for the DB2 database, HDS provides these translations:
DB2 to Adaptive Server and Adaptive Server to DB2
DB2 to Informix and Informix to DB2
DB2 to Microsoft SQL Server and Microsoft SQL Server to DB2
DB2 to Oracle and Oracle to DB2
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:
If no translation is specified for the Sybase datetime datatype, no translation is performed; the base datatype of datetime is datetime.
If no translation is specified for rs_db2_timestamp, any rs_db2_timestamp value routed through the connection is translated to char(26), its base datatype.
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”.