7.9.6 Objects Filtering

Filters are used by Apply Process to filter out data while processing DML operations. The filter should be configured for either single table or group of the tables and at least for one DML operation. The filtering statement might also be provided, which is to be used to construct “where” condition of the DML statement. If the filtering statement is not provided, then the Apply Process will ignore this DML operation.

The syntax used is:

filter=id,rule=(table_mask;dml_operations;”filter_statement”)

where:

  • id – The id, which is unique to each Filter has the purpose of determining the order in which the Filter is used by the Apply Process.
  • table_mask – It is used to specify list of the tables. The format is schema _name.table_name and the % symbol may be used in order to match any number of characters.
  • dml_operations – List of the DML operations separated by comma. The valid DML operations are: INSERTUPDATE,DELETE.
  • filter_statement – The statement to be used to build the “where” clause of DML operation.

The following examples show various ways of defining the Filter parameters:

  • Skip any “delete” operations for “logs” table in “scott” schema:
filter=1,rule=(scott.logs;DELETE;””)
  • Skip any “delete” operations for the dbo.orders table if processed column equal to “1”:
filter=2,rule=(dbo.orders;DELETE;”processed=1”)
  • Skip any DML operations for thedbo.emp table if the info column has “do_not_replicate” value:
filter=3,rule=(dbo.emp;INSERT,UPDATE,DELETE;”info=’do_not_replicate’”)
  • Do not insert record into the dbo.acct table if the record with the same id already exists:
filter=4,rule=(dbo.acct;INSERT;”id in (select id from dbo.acct)”)