![]() |
|
Archives of the TeradataForumMessage Posted: Thu, 14 Apr 2016 @ 10:22:48 GMT
Bob Diehl suggested
That 'sounded' like a great idea, until I then discovered that Soundex only works on Latin characters, for example (straight from the manual) this doesn't work : SELECT SOUNDEX('?b?'); The characters ? and ? are not simple Latin characters. Pity, really thought we were onto something here. Just had a thought ..... what if I strip all the accented characters out and replace them with the English equivalent .... hmm .... something like this :
SELECT lower('?my????name') as MyMadeupName ,case when REGEXP_INSTR(MyMadeupName,
'?|?|?|?|?') > 0
then
REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(MyMadeupName,'
?','z'),'?','c'),'?','u'),'?','e'),'?','s')
else MyMadeupName
end as myLatinMadeupName
,case when myLatinMadeupName = 'Smyzcuename'
then 'Matched'
else 'Failed to Match' end
as Match_Result
;
gives :
?my????name smyzcuename Matched
Ha ! I suppose I could always wrap the RegExp concatenated Functions into an SQL Function, that would make it look a bit prettier. Regards David Clough
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| | https: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 24 Jul 2020 | |||||||||||||||||||||||||||||||||||||||||||||||||||