Updating the rs_translation Table for Derived Function-String Classes

This example shows you how to update the rs_translation table in the Replication Server System Database (RSSD) to ensure that the derived class you created inherits the class-level translations from the parent class.

  1. Create the derived function-string class in Replication Server.
    For example, to create the private_class_for_oracle derived function-string class for Oracle, enter:
    create function string class private_class_for_oracle 
    set parent to rs_oracle_function_class
    go
    
    Ensure that you specify the appropriate non-ASE database base class as your parent class when you create the derived class. See Function-String Inheritance in the Replication Server Administration Guide Volume 2.
  2. Use an SQL select statement to obtain the class ID of private_class_for_oracle from the rs_classes Replication Server system table:
    select classid from rs_classes where classname='private_class_for_oracle'
    go
    You see:
    classid
    ------------------
    0x0100006801000065
    
    (1 row affected)
    
  3. Obtain the class-level translations defined for rs_oracle_function_class:
    select * from rs_translation where classid = 0x0000000001000007
    go
    You see (split into two sets of four columns for clarity):
    prsid classid            type source_dtid        
    ----- ------------------ ---- ------------------ 
        0 0x0000000001000007 D    0x0000000000000001 
        0 0x0000000001000007 D    0x000000000000000c 
        0 0x0000000001000007 D    0x000000000000000d 
        0 0x0000000001000007 D    0x000000000000000e 
        0 0x0000000001000007 D    0x000000000000000f 
        0 0x0000000001000007 D    0x0000000000000013 
        0 0x0000000001000007 D    0x000000000000001b 
        0 0x0000000001000007 D    0x000000000000001c 
    
    target_dtid        target_length target_status rowtype
    ------------------ ------------- ------------- -------
    0x0000000000010202 0             0             0
    0x0000000000010200 19            0             0
    0x0000000000010200 19            0             0
    0x0000000000010205 136           0             0
    0x0000000000010205 136           0             0
    0x0000000000010202 0             0             0
    0x0000000000010201 9             0             0
    0x0000000000010213 8             0             0
    
    (8 row affected)
    
  4. For each row returned in step 3, build SQL insert statements to insert the class-level translation values you obtained in step 3 into the private_class_for_oracle derived function-string class.
    Use the template:
    insert into rs_translation
    (prsid, 
    classid, 
    type, 
    source_dtid, 
    target_dtid, 
    target_length, 
    target_status, 
    rowtype)
    values (0,
    classid from step 2, 
    'D',
    source_dtid from output of 3,
    target_dtid from output of step 3,  
    target_length from output of step 3, 
    target_status from output of 3, 
    0)

    See rs_translation in the Replication Server Reference Manual.

    For example, the insert statement for the first row for the private_class_for_oracle derived function-string class should be:
    insert rs_translation values (0, 0x0100006801000065, 'D', 0x000000000000000c, 0x0000000000010200, 19, 0, 0)
    
  5. Execute the insert statements you built in step 4:
    insert rs_translation values (0, 0x0100006801000065, 'D', 0x000000000000000c, 0x0000000000010200, 19, 0, 0)
    insert rs_translation values (0, 0x0100006801000065, 'D', 0x000000000000000d, 0x0000000000010200, 19, 0, 0)
    insert rs_translation values (0, 0x0100006801000065, 'D', 0x0000000000000001, 0x0000000000010202, 0, 0, 0)
    insert rs_translation values (0, 0x0100006801000065, 'D', 0x0000000000000013, 0x0000000000010202, 0, 0, 0)
    insert rs_translation values (0, 0x0100006801000065, 'D', 0x000000000000000E, 0x0000000000010205, 136, 0, 0)
    insert rs_translation values (0, 0x0100006801000065, 'D', 0x000000000000000f, 0x0000000000010205, 136, 0, 0)
    insert rs_translation values (0, 0x0100006801000065, 'D', 0x000000000000001b, 0x0000000000010201, 9, 0, 0)
    insert rs_translation values (0, 0x0100006801000065, 'D', 0x000000000000001c, 0x0000000000010213, 8, 0, 0)
  6. Restart Replication Server if the rs_translation rows for your classid were already in the RSSD. Otherwise, you can restart Replication Server to ensure the proper execution of your derived function-string class.
After you update rs_translation, you can use the derived function-string class for a connection to the corresponding non-ASE database.