Solved

SQL convert diacritic to anglicized form

Posted on 2011-09-20
6
998 Views
Last Modified: 2012-05-12
Hello All,

We need to convert diacritic supplied by the front end to anglicized form to search

For example:

(ÀÖÙãas) to (AOUaas), because the database column we have does not contain diaciritc, so we if user added a diacritic character we need to search with non diacritic form.

Please help

Thank you
0
Comment
Question by:dojjol
  • 4
  • 2
6 Comments
 
LVL 15

Expert Comment

by:x77
ID: 36567870

  S has 6 chars.
  Normalized string has 10 chars. Each diacritic char is decomposed.

  I added all chars from s1 to Sb except NonSpacingMark chars.
Dim s = "ÀÖÙãas"
     Dim s1 = s.Normalize(NormalizationForm.FormD)
     Dim sb As New StringBuilder(s.Length)
     For Each c In s1
         If Char.GetUnicodeCategory(c) = Globalization.UnicodeCategory.NonSpacingMark Then Continue For
         sb.Append(c)
     Next
     Debug.Print(sb.ToString)

Open in new window

0
 

Author Comment

by:dojjol
ID: 36567906
thank x77, is it a stored procedure?
0
 
LVL 15

Expert Comment

by:x77
ID: 36567932
Sorry.

SELECT CONVERT('Ä Ê Í Õ Ø A B C D E','US7ASCII','WE8ISO8859P1')
FROM DUAL;
A E I ? ? A B C D E

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 15

Expert Comment

by:x77
ID: 36567951
SELECT CONVERT('ÀÖÙãas','US7ASCII') FROM DUAL;    ->AOU?as
0
 

Author Comment

by:dojjol
ID: 36568308
thanks again, but we missed 'Ù' and is replaced as '?' in AOU?as, so not really sure this will work for me
0
 
LVL 15

Accepted Solution

by:
x77 earned 500 total points
ID: 36568574
Yes, I see on my machine that "Õ" Translates to ?, But I am work with Spanish.

You can try a char_set_from that contains this leter.
http://www.techonthenet.com/oracle/functions/convert.php

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Array of Key/Value Pairs as input to Oracle function 10 53
sql query 5 70
how to replace '&' and '()' in sql query for oracle using regex 8 61
oracle 11g 23 51
Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now