首页 > 数据库 > Oracle > GoldenGate中filter参数限制行
, FILTER (Or...
[, ON INSERT | ON UPDATE| ON DELETE]
[, IGNORE INSERT | IGNORE UPDATE | IGNORE DELETE]
, <filter clause>);
, FILTER (Valid FILTER clause elements are the following:
[, ON INSERT | ON UPDATE| ON DELETE]
[, IGNORE INSERT | IGNORE UPDATE | IGNORE DELETE]
[, RAISEERROR ]
, <filter clause>);
● An Oracle GoldenGate column-conversion function. These functions are built into下面是官方给出的几个例子:
Oracle GoldenGate so that you can perform tests, manipulate data, retrieve values,
and so forth. For more information about Oracle GoldenGate conversion functions, see
“Testing and transforming data” on page 158.
● Numbers
● Columns that contain numbers
● Functions that return numbers
● Arithmetic operators:
+ (plus)
- (minus)
* (multiply)
/ (divide)
\ (remainder)
● Comparison operators:
> (greater than)
>= (greater than or equal)
< (less than)
<= (less than or equal)
= (equal)
<> (not equal)
Results derived from comparisons can be zero (indicating FALSE) or non-zero (indicating TRUE).
● Parentheses (for grouping results in the expression)
● Conjunction operators: AND, OR
MAP SALES.TCUSTORD, TARGET SALES.TORD,
FILTER (@COMPUTE (PRODUCT_PRICE*PRODUCT_AMOUNT) > 10000);
Example 2 The following uses the @STREQ function to extract records where a string is equal to ’JOE’.This example assumes that the USEANSISQLQUOTES parameter is used in the GLOBALS parameter file to apply SQL-92 rules for single and double quote marks.
TABLE ACCT.TCUSTORD, FILTER (@STREQ ("Name", ’joe’) > 0);Example 3 The following selects records in which the amount column is greater than 50 and executes the filter on updates and deletes.
TABLE ACT.TCUSTORD, FILTER (ON UPDATE, ON DELETE, AMOUNT > 50);Example 4 You can use the @RANGE function to divide the processing workload among multiple FILTER clauses, using separate TABLE or MAP statements. For example, the following splits the replication workload into two ranges (between two Replicat processes) based on the ID column of the source acct table.
MAP "sales"."acct", TARGET "sales"."acct", FILTER (@RANGE (1, 2, ID));
(Replicat group 2 parameter file)
MAP "sales"."acct", TARGET "sales"."acct", FILTER (@RANGE (2, 2, ID));
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/205377/viewspace-2081561/ ,如需转载,请注明出处,否则将追究法律责任。