ondro tadanai
ondro tadanai

Reputation: 69

Remove interpunctional characters

Im looking for some way to remove interpunction in varchar2. Thats mean i want to get "Marian" from "Marián" and "Cernicky" from "Černický" Thanks for any help or suggestion Ondrej

Upvotes: 3

Views: 75

Answers (1)

Justin Cave
Justin Cave

Reputation: 231781

with x as (
  select 'Černický' name from dual union all
  select 'Marián' from dual
)
select convert(name, 'US7ASCII')  
  from x;

will work for any name where there is an appropriate replacement character in the US7ASCII character set for the character in question. That's not necessarily the case for every possible character-- Õ and Ø, for example, would both be converted to a question mark (?). But this does work for both of your examples.

Upvotes: 1

Related Questions