The condition you just defined applies to the single target table in the table mapping. Only the records that satisfy the condition are sent to that target, and all other records are ignored. The following steps extend the example by adding multiple targets and conditions to the record distribution. The goal is to route the post-August 1, 2003, records to one target, the pre- August 1, 2003, records to a second target, and the pre-2003 records to a third target.
In this case, the source table information is forwarded to one of three target databases depending on when a customer has purchased the identified product item.
-
On the Sending Table Properties dialog box for the sending table, select the Mapping tab.
-
In the Receiving server and Receiving table lists, select one of the additional alternative targets for the source records.
-
Complete the column mapping for this target, then select the Gate Condition tab of the Sending Table Properties dialog box.
-
Specify the following expression in the workbox, using the Column and Operator lists as necessary:
ITEM_ID == '01323AA' and (SALE_DATE < ‘20030801’ and SALE_DATE >= ‘20030101’)
Note: Combining two clauses as in the following construction is not valid:‘20030101’ < SALE_DATE <= ‘20030801’
-
To verify that your expression is syntactically valid, click the Validate button, then click the OK button when the validation completes successfully.
-
Repeat Steps step 2 through step 5 for the third target table and the following expression:
ITEM_ID == '01323AA' and SALE_DATE < ‘20030101’
The table mappings display as usual in the Target Tables branch for the sending table, and they include a [Gated] label as well as their conditional expression: