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. You can skip the following procedure if you have already defined a replication definition.

NoteIf you have not already done so, you must 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. Record the information in Appendix A, “Configuration Worksheets.”

To create the replication definition:

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

  2. Create the table replication definition using the create replication definition command:

    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 the create replication definition command, see the Replication Server Administration Guide and the Replication Server Reference Manual.

StepsCreating a function replication definition

To create a function replication definition in Replication Server:

  1. Gather the following information and record it on your worksheet, in Appendix A, “Configuration Worksheets,” where appropriate:

  2. Create the function replication definition using the create function replication definition command:

    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 create function replication definition command, see the Replication Server Administration Guide and the Replication Server Reference Manual.