Vertical filtering uses the Target columns page of the Advanced Subscription Definition notebook for DB2 DataPropagator subscriptions and the Rows page of Advanced Replication Subscription notebook for JDBC subscription. To open either of these notebooks:
This section uses a sample table with 7 columns. The characteristics of this sample table are:
Column name data type nullable? default value NOTNULLINT1 INTEGER NO NOTNULLCHAR1 CHAR NO NOTNULLDATE1 DATE NO DEFAULTINT1 INT YES 1000 DEFAULTCHAR1 CHAR YES 'a' DEFAULTDATE1 DATE YES '2001-06-29' ID INTEGER NO
The ID column is the primary key.
Procedure
To vertically filter data:
The default value data-filter parameters are used by the group to provide a default value for the unsubscribed columns. Data inserted to the data source from the client will be composed of the columns of data on the client combined with default column values defined for the group to complete the rows of data inserted to the data source. The next step is to define the default value data filter parameter values.
Related tasks
Related reference
Vertical filtering uses the Target columns page of the Advanced Subscription Definition notebook for DB2 DataPropagator subscriptions and the Rows page of Advanced Replication Subscription notebook for JDBC subscription. To open either of these notebooks:
This section uses a sample table with 7 columns. The characteristics of this sample table are:
Column name data type nullable? default value NOTNULLINT1 INTEGER NO NOTNULLCHAR1 CHAR NO NOTNULLDATE1 DATE NO DEFAULTINT1 INT YES 1000 DEFAULTCHAR1 CHAR YES 'a' DEFAULTDATE1 DATE YES '2001-06-29' ID INTEGER NO
The ID column is the primary key.
Procedure
Defining the default value data-filter parameters:
100
A special value can also be used. The value $USERNAME allows a Sync Server user ID to be inserted as the value of the parameter. This allows you to have rows created by specific users inserted into the data source with their Sync Server user ID in a specific field. For example, for :PARAMCHAR1 type:
$USERNAME
Now all rows inserted into the sample table will have the Sync Server user ID inserted into the NOTNULLCHAR1 column. For the example table, add two more parameters:
:PARAMDATE1. '2001-06-29' :PARAMINT2. 15
Every user assigned to the filtered group will receive will receive only the 3 subscribed columns of the sample table. When a user inserts a new row in the table, it is synchronized to the data source using default values for the group in each of the unsubscribed columns. If the $USERNAME keyword is used in the data filter, the user ID of the user who inserted the row will be inserted for the value of that filtered column. Also, individual users may have specific default values that differ from the group default value configured on a user basis.
Related tasks
Related reference
Procedure
dbname=DATABASE;procname=PROCEDURE
where DATABASE is the name of the database used by the stored procedure, and PROCEDURE is the name of the stored procedure. For example to use stored procedure SP1 from data source DS1 and stored procedure SP2 from data source DS2, the following string is used:
dbname=DS1;procname=SP1;dbname=DS2;procname=SP2
Related concepts
This example uses a DB2 database named MYSAMPLE. You need to manually create the MYSAMPLE database.
Procedure
To create the MYSAMPLE database, enter the following statements at the DB2 command prompt:
CREATE table db2e.MYACCOUNT ( Name char(16), Saving int, Checking int) INSERT into db2e.MYACCOUNT values('Michael', 5000, 5000) INSERT into db2e.MYACCOUNT values('Frank', 5000, 5000)
After creating the database, create a stored procedure to modify the data in the database.
Related concepts
Related tasks
Related reference