This section is not applicable to Sybase Replication Agent support
for DB2 Universal Database.
When a primary table is marked for replication, trigger-based Replication Agents create a shadow table to record the replicated operations. The shadow table has all the columns of the primary table, plus three or four columns (depending on the type of primary database) that the Replication Agent creates for its use:
ra_tran_id_
ra_img_type_
ra_opid_ (Microsoft SQL Server and Oracle only)
ra_opid_hi (Informix only)
ra_opid_lo (Informix only)
These names are fixed and cannot be changed.
In an Informix primary database, column names in a primary
table may also conflict with global variable names that the Replication Agent uses
in its stored procedures. See Appendix B, “Administering the Replication Agent for Informix,” for more information.
When a stored procedure is marked for replication, the Replication Agent creates a shadow table with a column for each parameter of the stored procedure, plus the columns the Replication Agent needs for its own use.
If the name of one of the columns in the primary table (or one of the parameters of the stored procedure) is the same as one of the Replication Agent columns in the shadow table, a SQL execution error occurs when you attempt to mark the table (or stored procedure). In addition:
The pdb_setreptable or pdb_setrepproc command returns an error.
The Replication Agent system log records the duplicate column name error message.
The marking script is generated, but not executed for the primary table (%SYBASE%\rax-12_5\instname\tablename\mark.sql) or stored procedure (%SYBASE%\rax-12_5\instname\procname\mark.sql).
All occurrences of the offending object name in the marking script are delimited as: <<name>>
To solve this problem, you have two options:
Change the name of the offending column or parameter in the primary object, then use the pdb_setreptable or pdb_setrepproc command again to mark the object.
If you want to keep the current name of the offending column or parameter in the primary object, you can edit the marking script (mark.sql) to change the name of the offending column (or parameter) in both shadow table DDL commands and the shadow row procedures, and remove the error delimiters (<< and >>) and leave the original column (or parameter) name unchanged in trigger code. After editing the marking script, you must execute it manually in the primary database.
Whether you change the primary object names in the database or modify the marking script, the Replication Agent replicates data using the new names, and you must make some accommodation at the replicate database to the name changes at the primary database.
You can either change the column (or parameter) names of the tables (or procedures) in the replicate database, or create a Replication Server function string to map the new primary object names to the original names in the replicate database.