Oracle7 Server Distributed Systems Volume II: Replicated Data

Contents Index Home Previous Next

Using Column Groups

The procedures available in the DBMS_REPCAT package allow you to create and delete column groups, and to add members to, and remove members from, an existing column group.

Creating a Column Group with Members

To create a new column group with one or more members, call the MAKE_COLUMN_GROUP procedure in the DBMS_REPCAT package, as shown in the following example:

DBMS_REPCAT.MAKE_COLUMN_GROUP(
    sname                => 'acct', 
    oname                => 'inv', 
    column_group         => 'address', 
    list_of_column_names => 'addr1, addr2, city, state, zip');

This example creates a column group called ADDRESS that consists of the ADDR1, ADDR2, CITY, STATE, and ZIP columns in the INV table.

To create a column group consisting of all of the columns in the table, you simply pass an asterisk (*) as the final argument to the call. You must call this procedure from the master definition site. Your changes take effect when you generate replication support for the table.

Additional Information: The parameters for the MAKE_COLUMN_GROUP procedure are described in Table 12 - 149, and the exceptions are listed in Table 12 - 150.

Adding Members to an Existing Column Group

To add members to an existing column group, call the ADD_GROUPED_COLUMN procedure in the DBMS_REPCAT package, as shown in the following example:

DBMS_REPCAT.ADD_GROUPED_COLUMN(
    sname                => 'acct', 
    oname                => 'inv', 
    column_group         => 'address', 
    list_of_column_names => 'phone, fax');

This example adds the columns PHONE and FAX to the ADDRESS column group created in a previous example. To add all of the columns in the table to the column group, you could specify '*' as the LIST_OF_COLUMN_NAMES value.

You must call this procedure from the master definition site. Your changes take effect when you generate replication support for the table.

Additional Information: The parameters for the ADD_GROUPED_COLUMN procedure are described in Table 12 - 62, and the exceptions are listed in Table 12 - 63.

Removing Members from a Column Group

To remove members from a column group, call the DROP_GROUPED_COLUMN procedure in the DBMS_REPCAT package, as shown in the following example:

DBMS_REPCAT.DROP_GROUPED_COLUMN(
    sname                => 'acct', 
    oname                => 'inv', 
    column_group         => 'address', 
    list_of_column_names => 'phone, fax');

This example removes the columns PHONE and FAX from the ADDRESS column group. To remove all of the columns in the table from the column group, you could specify '*' as the LIST_OF_COLUMN_NAMES value.

You must call this procedure from the master definition site. Your changes take effect when you generate replication support for the table.

Additional Information: The parameters for the DROP_GROUPED_COLUMN procedure are described in Table 12 - 119, and the exceptions are listed in Table 12 - 120.

Dropping a Column Group

To drop a column group, call the DROP_COLUMN_GROUP procedure in the DBMS_REPCAT package, as shown in the following example:

DBMS_REPCAT.DROP_COLUMN_GROUP(
    sname        => 'acct', 
    oname        => 'inv', 
    column_group => 'address');

This example drops the ADDRESS column group associated with the INV table.

You must call this procedure from the master definition site. Your changes take effect when you generate replication support for the table.

Additional Information: The parameters for the DROP_COLUMN_GROUP procedure are described in Table 12 - 117, and the exceptions are listed in Table 12 - 118.

Creating an Empty Column Group

To create a new, empty column group, call the DEFINE_COLUMN_GROUP procedure in the DBMS_REPCAT package, as shown in the following example:

DBMS_REPCAT.DEFINE_COLUMN_GROUP(
    sname => 'acct', 
    oname => 'inv', 
    gname => 'address');

This example creates the ADDRESS column group associated with the INV table. This column group has no members. You must call the ADD_GROUPED_COLUMN procedure to add members to this group.

You must call this procedure from the master definition site. Your changes take effect when you generate replication support for the table.

Additional Information: The parameters for the DEFINE_COLUMN_GROUP procedure are described in Table 12 - 109, and the exceptions are listed in Table 12 - 110.


Contents Index Home Previous Next