Horizontal filtering at the subscription level, group level, or user level
uses an SQL clause to select data from the source data source. The
contents of the SQL clause are controlled by the Rows page of the
Advanced Subscription Definition notebook for DB2 DataPropagator
subscriptions and the Rows page of Advanced Replication Subscription notebook
for JDBC subscriptions.
Procedure
- Create or edit a JDBC subscription or DataPropagator subscription.
- Click Define Subscription. The Define Replication
Subscription window opens.
- Click Advanced. For DB2 DataPropagator subscriptions,
the Advanced Subscription Definition notebook opens. For JDBC
subscriptions, the Advanced Replication Subscription notebook opens.
- On the Rows page, type an SQL clause in the Subset of rows for
individual users box. Do not type WHERE at the beginning of the
SQL clause. WHERE is automatically appended to the clause typed in the
box. Instead of using a value in the SQL clause, insert a
parameter. For example, to filter the VNPERSON table based on the value
of the parameter :fcity for the city column and the value of
the parameter :fid for the id column, type:
city=':fcity' and id=':fid'
where :fcity is a parameter for the city column value and
:fid is a parameter for the id column value.
- Complete and close the Create Subscription notebook.
- Open a Create or Edit Group notebook for the group of users you want to
filter. The subscription you created with the filter parameters must be
assigned to the group you are editing.
- On the Data filter page of the Group notebook, click
Add.
- Type :fcity in the Parameter name
field.
- Type a default value in the Default value field. For
example:
Los Angeles, CA 90061
- Click OK.
- Click Add again to add the second parameter.
- Type :fid. in the Parameter name
field.
- Click OK.
- Complete and close the Group notebook.
- Open a Create or Edit User notebook for the user you want to
filter. The user must be assigned to the group with the filter
parameters.
- On the Data filter page of the Group notebook, select the
:fid parameter and click Change.
- Type a value in the User override field. For
example, to override the value of :fid for this user and set it
to 900000401, type:
900000401
- Click OK.
- Note:
- Horizontal filtering only occurs from server to client. If a client
inserts a row that is not be included in the filter, the rows will be inserted
into the source.
Related tasks
Related reference