Creating the replication definition

A replication definition describes the data that can be replicated for a table or stored procedure defined in the primary database. RepConnector supports replication of DML commands and stored procedures. If you have already defined a replication definition, skip this procedure.

If you have not already done so, mark primary tables or stored procedures for replication before continuing.

StepsCreating a table replication definition in Replication Server

At the Replication Server, create the replication definition for the table you want to replicate. You must know the Adaptive Server name and database name in which the primary table resides.

  1. Gather the following information and record it on your worksheet where appropriate:

  2. Create the table replication definition:

    create replication definition
         <replication_definition_name>
    with primary at
         <dataserver>.<database>
    with all tables named '<table_name>'
    ( <column_name> <column_datatype>,
         …)
    primary key (<column name>,..))
    searchable columns (<column_name>,..)
    

    where:

    For example:

    create replication definition authors_rep
    with primary at primary_ase.pubs2
    with all tables name 'authors' (
         au_id varchar(11),
         au_lname varchar(40),
         au_fname varchar(20),
         phone char(12),
         address varchar(40),
         city varchar(20),
         state char(2),
         country varchar(12),
         postalcode char(10))
    primary key (au_id)
    searchable columns(au_id)
    

For more information about create replication definition, see the Replication Server Administration Guide and the Replication Server Reference Manual.

StepsCreating a function replication definition

  1. Gather the following information and record it on your worksheet, where appropriate:

  2. Create the function replication definition:

    create function replication definition <relication_definition_name> 
    with primary at <dataserver>.<database>
    deliver as '<procedure_name>' (
         <@param_name> <datatype>,
         …)
    searchable parameters (<@param_name>,..>)
    

    where:

    For example:

    create function replication definition ins_authors with primary at primary_ase.pubs2(
         @au_id varchar(11),
         @au_lname varchar(40),
         @au_fname varchar(20),
         @phone char(12),
         @address varchar(40),
         @city varchar(20),
         @state char(2),
         @country varchar(12),
         @postalcode char(10))
    )
    searchable parameters(@au_id)
    

    For more information about the command create function replication definition, see the Replication Server Administration Guide and the Replication Server Reference Manual.