Index Function
Posted: Tue Jul 28, 2009 8:09 am
Hi
1) select * from Employee where name like '%ABC XYZ%'
2)select * from Employee where name like '%ABC%XYZ%'
In the second query there is extra % between 'ABC' and 'XYZ'.
Similar scenario in DataStage i am using Index funtion for string comparion for the above case1 , i am using some thing like
if Index(Name,"ABC XYZ",1)<>0 then 1 else 0
But my question is how should to deal with the case2 where we got extra '%' ?
I need to compare the substrings like where there can be any number of spaces between 'ABC' & 'XYZ' or '-' or '.' or ',' etc. between them.
I am not using the SQL queries any where, i just gave an example only.
Need to resolve through DataStage job.
Your will be much appreciated .
Thanks
1) select * from Employee where name like '%ABC XYZ%'
2)select * from Employee where name like '%ABC%XYZ%'
In the second query there is extra % between 'ABC' and 'XYZ'.
Similar scenario in DataStage i am using Index funtion for string comparion for the above case1 , i am using some thing like
if Index(Name,"ABC XYZ",1)<>0 then 1 else 0
But my question is how should to deal with the case2 where we got extra '%' ?
I need to compare the substrings like where there can be any number of spaces between 'ABC' & 'XYZ' or '-' or '.' or ',' etc. between them.
I am not using the SQL queries any where, i just gave an example only.
Need to resolve through DataStage job.
Your will be much appreciated .
Thanks