One Star

Reg: Equivalent of LIKE operator in talend

Hi,
I have seen couple of post for LIKE operator in Talend forum. Just to be specific.
How can I implement following examples with Like operator in talend.
1) select * from employee where name like '%james%';
2) select * from employee where name like '%mes';
SQL override is one of the option available.
But is there any function on talend supports the above functionality.
The literal meaning of the above examples are
1) Column name should contain "james"
2) Column name should ends with "mes"
Best Regards
Naju
4 REPLIES
One Star

Re: Reg: Equivalent of LIKE operator in talend

Just use the select in a tDatabasetypeInput component.
One Star

Re: Reg: Equivalent of LIKE operator in talend

Janhess,
Thanks for the reply. I was aware that we can do the above functionality through the DatabasetypeInput component (Using SQL Override). But I wanted to know whether is their any function in talend supports the above the functionality of LIKE operator.
Regards
Naju
One Star

Re: Reg: Equivalent of LIKE operator in talend

There's a tFuzzyMatch component in the Data Quality components.
The Apache string utilities has a containsIgnoreCase function if you want to see how it's done. You could add it to the Routines.
Or see http://stackoverflow.com/questions/898405/how-to-implement-a-sql-like-like-operator-in-java for implementations of string.startsWith, string.endsWith and string.contains.
One Star

Re: Reg: Equivalent of LIKE operator in talend

Sí hay una solución:

m8.DESC_LARGA_ZONA.contains("%MONITOR%"))?2:1
es decir, utilizando .contains
Smiley Happy