IBM Books

Replication Guide and Reference


Defining Join Replication Sources

You can define replication sources that are views of other tables. After defining each replication source table included in the view, you can create a view replication source. The view replication source is then available to be copied to a target table.

You cannot define an existing view as a replication source.

To define a join:

  1. Define as replication sources the source tables to be used in the join. See "Defining Replication Sources".

  2. From the Control Center object tree, click on the Replication Sources folder and select the replication sources to be used in the join from the contents pane.

  3. Click mouse button 1 and select Define join from the pop-up menu. The Define Join window opens, as shown in Figure 19.

    Figure 19. The Define Join Window. You can define joins as replication sources.
    * Figure ASNV2108 not displayed.


  4. To view a list of columns available for the join:

    1. Select a table name from the Selected tables box.

    2. Select Show Columns. The Show Columns window opens and shows all of the columns in the selected table.

    3. Select OK to close the window and continue defining the join.

  5. In the CREATE VIEW field, type the SQL statement for the view. For example:
    USERID.VIEW_NAME AS SELECT A.COL1, A.COL2, B.COL6, B.COL5
    

    This field can contain ordinary or delimited identifiers. See "Ordinary and Delimited Identifiers" for more information.

    Do not type the words CREATE VIEW. This part of the statement is automatically supplied during processing.

  6. In the FROM field, type the SQL statement for the view. For example:
    TABLEA A, TABLEB B
    

    This field can contain ordinary or delimited identifiers. See "Ordinary and Delimited Identifiers" for more information.

    Do not type the word FROM. This part of the statement is automatically supplied during processing.

  7. If you want to use a row predicate, type the WHERE clause SQL statement in the WHERE field. For example:
    A.COL1=B.COL1
    

    This field can contain ordinary or delimited identifiers. See "Ordinary and Delimited Identifiers" for more information.

    Do not type word WHERE. This part of the statement is automatically supplied during processing.

  8. Select OK to save the values and close the window. The Run Now or Save SQL window opens. Specify whether to submit the replication request now or save the SQL statements generated by the action in a file to be run later. See "Customizing and Running Replication SQL Files" to learn how to submit the request now or later.

  9. After you submit the request, verify that the replication source was created by selecting the Replication Sources folder in the object tree and selecting the Refresh menu choice.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]