Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6133519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:14:22+00:00 2026-05-23T17:14:22+00:00

Our Oracle DB is UTF8. We are storing addresses that need to be searchable.

  • 0

Our Oracle DB is UTF8. We are storing addresses that need to be searchable. Some of the street names contain non-english characters (e.g. Peña Báináõ ) this needs to be searchable either as “Peña Báináõ” or with english equivalent charactes like “Pena Bainao“. What we did is to convert the text on the query, something like:

SELECT CONVERT('Peña Báináõ','US7ASCII') as converted FROM dual;

But the issue here is that not all of the characters have an English equivalent (not even some pretty obvious ones like ñ or õ) so we end up with the text converted to:

Pe?a Baina?

So if the user tries to find that addres typing “Pena Bainao” he can’t find it because “Pena Bainao” is different from “”Pe?a Baina?“”.

We have figured out some dirty workarrounds on this, but I wanted to check first if someone has found a more elegant solution.

Here is a list of some characters that are not converted to US7ASCII:

Character     UTF8 Code     Possible Equivalent   
æ         -   u00E6      -      ae
å         -   u00E5      -       a
ã         -   u00E3      -       a
ñ         -   u00F1      -       n
õ         -   u00F5      -       o
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:14:23+00:00Added an answer on May 23, 2026 at 5:14 pm

    1) Using nlssort with BINARY_AI (Both case and accent insentive):

    SQL> select nlssort('Peña Báináõ', 'NLS_SORT = BINARY_AI') C from dual;
    
    C
    ------------------------
    70656E61206261696E616F00
    
    SQL> select nlssort('Pena Bainao', 'NLS_SORT = BINARY_AI') C from dual;
    
    C
    ------------------------
    70656E61206261696E616F00
    
    SQL> select nlssort('pena bainao', 'NLS_SORT = BINARY_AI') C from dual;
    
    C
    ------------------------
    70656E61206261696E616F00
    
    SQL> select 'true' T from dual where nlssort('pena bainao', 'NLS_SORT = BINARY_AI') = nlssort('Peña Báináõ', 'NLS_SORT = BINARY_AI') ;
    
    T
    ----
    true
    

    2) You could also alter the NLS_SORT session variable to binary_ai and then you would not have to specify NLS_SORT every time:

    SQL> select 'true' T from dual where nlssort('pena bainao') = nlssort('Peña Báináõ') ;
    
    no rows selected
    
    SQL> alter session set nls_sort = binary_ai;
    
    Session altered.
    
    SQL> select 'true' T from dual where nlssort('pena bainao') = nlssort('Peña Báináõ') ;
    
    T
    ----
    true
    

    3) To drop the use of nlssort function and change the sematics of everything, also set the nls_comp session variable:

    SQL> select 'true' T from dual where 'pena bainao' = 'Peña Báináõ';
    
    no rows selected
    
    SQL> alter session set nls_comp = linguistic;
    
    Session altered.
    
    SQL> select 'true' T from dual where 'pena bainao' = 'Peña Báináõ';
    
    T
    ----
    true
    

    Option 1 changes only local behavior, the query where you want different results. Option 2 and 3 will change behavior of other queries and may not be what you want. See Table 5-2 of Oracle® Database Globalization Support Guide. Also look the section “Using Linguistic Indexes” to see how to be able to use indexes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some Materialized views in our Oracle 9i database that were created a
I need to find all the tables in our Oracle database that have attributes
We are planning to migrate our DB to Oracle.We need to manually check each
Our application has a couple of shell scripts that are called from web-based Oracle
We have a shell script that perform a physical backup of our oracle database
I need to retrieve quite a bit of data from our oracle DB and
We are currently migrating one of our oracle databases to UTF8 and we have
I need some help from Oracle/Security experts. I'm going to make functions for encryption/decryption
I'm working on some Oracle performance issues with our web app. One thing I've
I need this update query to run on both SQL Server and Oracle. Our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.