Filtering rows using the %GETCOL function (Dynamic SQL)
An example of how to filter rows using the %GETCOL function.
This example refers to the primary and secondary table relationship. The table names referenced in the examples follow the format for the CDC Replication Engine for Microsoft SQL Server and CDC Replication Engine for Sybase databases. If you installed another CDC Replication replication engine, see the table_name parameter in this function for more information about specifying table names which depends on your database.
To use the example, you must add a derived column to the MASTER.DBO.EMPLOYEE primary table and enter the specified %GETCOL function in that column.
%GETCOL(COUNTRYS, MASTER.DBO.STATE
, , STATES, STATE)
= 'USA'
This example uses the %GETCOL function in a row-filtering expression.
The function retrieves values of the COUNTRYS column from the MASTER.DBO.STATE
table and compares them with 'USA'. Depending on your row filtering
settings on the Filtering tab, rows in the
MASTER.DBO.EMPLOYEE primary table, with a COUNTRYS value set to USA,
are either selected or omitted for replication.