SymmetricDS - help for row filter with subselect and ROUTER_EXPRESSION

26 Views Asked by At

I am new to symmetricds.

When inserting a new record into the PRT_ITEM table, I need to reference the PRT_SUPPLIER table for the supplier code. If the PORTAL_ENABLED field is marked as "Y," the new record should be included in the replication subselection. In all other instances, it should be skipped.

I had created a custom router in SYM_ROUTER with subselection as ROUTER_TYPE - subselect ROUTER_EXPRESSION - c.external_id in (select SUPPLIER_CODE from prt_supplier where SUPPLIER_CODE=:SUPPLIER_CODE and PORTAL_ENABLED='Y')

and custom trigger SYM_TRIGGER as EXTERNAL_SELECT - select supplier_code from prt_supplier where supplier_code=$(curTriggerValue).$(curColumnPrefix)supplier_code and portal_enabled = 'Y'

But this not working. Any clue what I am missing here

TABLE - PRT_ITEM ITEM_ID NAME SUPPLIER_CODE

11000001 Yummy Gum S001 11000002 Noodles S001 11000003 Soft Drink S002

TABLE - PRT_SUPPLIER SUPPLIER_CODE SUPPLIER_NAME PORTAL_ENABLED

S001 ABC Limited Y S002 XYZ Corporation N S003 STAR INTERNATIONAL N

Please guide to fix this

0

There are 0 best solutions below