CSL
CSL

Reputation: 75

SymmetricDS: How to filter row using sql statement in router?

I have a condition such as SELECT * FROM table1 WHERE table1.Status = 'A' and table1.Description like '%valid%' How could I put this statement inside the router so that I know which row should send to target ?

Upvotes: 1

Views: 155

Answers (1)

Boris Pavlović
Boris Pavlović

Reputation: 64632

Try the subselect router which allows for custom queries definition:

select node_id
from   sym_node
where  0 < (
  select count(*)
  FROM   table1 
  WHERE  table1.Status = 'A' 
  and    table1.Description like '%valid%'
  and    table1.id = :id
);

Upvotes: 0

Related Questions