Commencer un nouveau sujet
Répondu

Conditions/case statements in Matchers

Can we have conditions or CASE statements in Matchers?



Meilleure réponse

A match condition in an xDM Matcher is a WHERE clause.  The engine essentially looks for pairs of records by selecting * from record1, record2 where (match condition).  

If, by run conditions you mean support a conditional match, the answer is yes. If you wanted to, for example, match records with the same name, with the condition that they are in the same country, you would add that condition as:

'(record1.name = record2.name) AND (record1.country = record2.country)'


"CASE" statements cannot be used in Matchers: a match condition is a WHERE clause expecting a Boolean result, so you are essentially already in a case statement, in the 'when' clause. But the logic you are looking to introduce can be realized using the appropriate combinations of AND and OR.

1 commentaire

Réponse

A match condition in an xDM Matcher is a WHERE clause.  The engine essentially looks for pairs of records by selecting * from record1, record2 where (match condition).  

If, by run conditions you mean support a conditional match, the answer is yes. If you wanted to, for example, match records with the same name, with the condition that they are in the same country, you would add that condition as:

'(record1.name = record2.name) AND (record1.country = record2.country)'


"CASE" statements cannot be used in Matchers: a match condition is a WHERE clause expecting a Boolean result, so you are essentially already in a case statement, in the 'when' clause. But the logic you are looking to introduce can be realized using the appropriate combinations of AND and OR.

Connexion pour poster un commentaire