Accent insensitive search without nls_comp

Is there a function to make oracle search accent insensitive? I can't use nls_comp so I would like to know if there is another way to accomplish it.
Thanks
M

Obviously your unknown database version running on an unknown OS is less then 11.1.0.7 . Statement from Oracle:
Known problems using NLS_COMP=LINGUISTIC.
While you can use LIKE with NLS_COMP=LINGUISTIC in 10.2 , we recommend to
use 11.1.0.7 seen using linguistic index for like operator is an 11g new feature ......
In other words there's a solution, when running the latest patchset for 11gR1.
Werner

Similar Messages

  • How to apply an accent-insensitive search to an interactive report?

    Hello all!
    I'm trying to put an accent-insensitive search on an interactive report here. For example, if I'm on the page that has the interactive report and if I click the column header of the interactive report, I get to see a search bar that dynamically shows the results that match your input. Now, when I enter "jager", I want to see *"Jägermeister"* as a search result. The search must be accent-insensitive, so that I don't have to enter the ä every time.
    My code is as follows:
    SELECT name
    FROM food_1
    WHERE name LIKE 'Jagerme%'
    AND NLSSORT(name) IS NOT NULL
    ORDER BY NLSSORT(name, 'NLS_SORT=GENERIC_M_AI');As you can see, I first tried getting a result through the SQL Command. It should return the row that has "Jägermeister" as name. However, it doesn't. It tells me "No data found". So, how do I alter my NLSSORT to search accent-insensitive?
    Some extra information, I edited the interactive report source to the following:
    SELECT DISTINCT a.name, a.foodid
    FROM food_1 a INNER JOIN foodunit_1 c
    ON a.foodid = c.foodid
    WHERE a.foodlanguageid = :P17_SET_LANGUAGE
    AND NLSSORT(a.name) IS NOT NULL
    ORDER BY NLSSORT(a.name, 'NLS_SORT=GENERIC_M_AI');I also tried doing ALTER SESSION before the SQL code, but it still gives me the same result: No data found.
    I'm using APEX version 4.1.1.00.23.
    Help and suggestions are more than welcome. ;)
    Thanks in advance,
    Magali

    I found it out!
    It's really ridiculous, actually.
    Remember this code?
    execute immediate ('ALTER session SET NLS_COMP=LINGUISTIC');
    execute immediate ('ALTER session SET NLS_SORT=BINARY_AI');Well, this code is perfectly fine. Only, it doesn't execute. This is because it was misplaced...This process is not executed when you place it in the current authentication scheme, under the "Post-Authenticatoin Process" part.
    You might wonder why this is, but I have the explanation to that.
    You see, when you use an interactive report, the page processing isn't executed when you use the search function of that interactive report... Because it's an interactive report, I guess.
    BUT.
    An ALTER SESSION from the security attributes, that will execute.
    So, the solution to my problem was, in this case:
    Go to "Application" --> "Shared Objects" --> "Security Attributes" --> "Database Session" --> "Initialization PL/SQL code". In there, you need to put:
    BEGIN
    EXECUTE IMMEDIATE 'ALTER session SET NLS_COMP=LINGUISTIC';
    EXECUTE IMMEDIATE 'ALTER session SET NLS_SORT=BINARY_AI';
    END;By doing this, there's no longer any need to edit the source code of the report!
    So, that's the solution. I can finally enter text without special characters in it, and get the corresponding data, with special characters... Ahh. :)
    I hope this is helpful to others as well now. ;)

  • Accent insensitive Search - plz help me correcting this query

    Hello,
    I just realized that with that query, if I search for "Montreal" (without the accent), I have all the following results, which is what I want
    SELECT
    "ID","TIT"
    from   "REGDOSSIERS" "RDO"
           where
             TRANSLATE(UPPER("TIT"),'ÀÂÉÈÊÎÔÛÙÜ','AAEEEIOUUU')
             like upper(nvl(replace('%' || "P1_REPORT_SEARCH || '%',' ','%'),"TIT"))
    RESULTS
    TIT
    Annuaires Lovell (Montréal et banlieue)
    Juridiction royale de Montréal. Dossiers, 1677-1769
    Montreal Witness, 1845-1938
    {code}
    But how to change it so when I look for: "Montréal" (with the accent) , I have also the same results? Right now, with Montréal, I have nothing
    thanks,
    Roseline
    Edited by: Roseline on 2009-10-01 18:58
    Edited by: Roseline on Oct 1, 2009 7:34 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    If you are on Oracle 10g you can use regexp expressions to do the search.
    Example
    with testdata as (select 'Montreal' txt from dual
                      union all select 'Montréal' txt from dual
                      union all select 'Montreâl' txt from dual
                      union all select 'Montreaux' txt from dual)
    /* end of test data creation */
    select txt from testdata
    where regexp_like (txt, 'Montr[[=e=]]al');
    txt
    Montreal
    Montréal[[=e=]] would be an equivalence class for the letter "e" and includes also searches for é, è, ê etc.
    The best solution mainly depends how your search string is build.
    If you just want to sort, then the nlssort function would be useful.
    Mentioning Nlssort I remembered there is a much better way to implement Accent insensitive search. You just need to set your NLS_SORT parameter correctly. Either to BINARY_AI (the AI means accent and case insensitiv) or add _AI to your nls langage.
    example
    ALTER SESSION SET NLS_COMP=LINGUISTIC;
    alter session set nls_sort = 'FRENCH';
    with testdata as (select 'Montreal' txt from dual
                      union all select 'Montréal' txt from dual
                      union all select 'Montreâl' txt from dual
                      union all select 'Montreaux' txt from dual)
    /* end of test data creation */
    select txt from testdata
    where txt = 'MONTREAL';
    no rows selects
    /* now change the nls sorting */
    alter session set nls_sort = 'FRENCH_AI';
    with testdata as (select 'Montreal' txt from dual
                      union all select 'Montréal' txt from dual
                      union all select 'Montreâl' txt from dual
                      union all select 'Montreaux' txt from dual)
    /* end of test data creation */
    select txt from testdata
    where txt = 'MONTREAL';
    txt
    Montreal
    Montréal
    MontreâlEdited by: Sven W. on Oct 2, 2009 8:34 AM
    Edited by: Sven W. on Oct 2, 2009 10:22 AM - corrected misleading regexp example.

  • Accent insensitive + Search for 2 non consecutive keywords

    Hi,
    In APEX, I have a query the search into a list of TITLE (TIT), with or without accents. I cannot search for 2 non-consecutive word in my title and have the result.
    Here an example:
    SELECT
    "ID","TIT"
    from   "REGDOSSIERS" "RDO"
    where
    instr(TRANSLATE(UPPER("TIT"),'ÁÂÈÉÊÍÓÚÜ','AAEEEIOUU'),upper(nvl(:P1_REPORT_SEARCH,"TIT")) ) > 0
    TIT
    Last name of the resolution
    King Henry the Sixth
    The Gazette
    The Comedy of Errors
    La vie enchanté
    Le bêtes et les oiseaux1- If I look for: Last Name_, I have this result:
    TIT
    Last name of the resolution2- If I look for: Last resolution*,
    I have NO RESULTS
    My Question: How to I rewrite my query to have be able to look for 2 keywords non consecutive in the field,
    thanks
    Roseline, Quebec, Canada
    Edited by: user8772975 on 2009-09-04 10:47
    Edited by: user8772975 on 2009-09-04 10:49
    Edited by: user8772975 on 2009-09-04 10:50
    Edited by: Roseline on Oct 1, 2009 7:27 PM

    Hi,
    If you know the order of the keywords (that is, if 'LAST' must come before 'RESOLUTION'):
    WHERE  str  LIKE '%LAST%RESOLUTION%'where str is the string with accents standardized.
    Now, since you're starting with a variable like 'LAST RESOLUTION', you need to convert it to '%LAST%RESOLUTION%', so say
    WHERE  str  LIKE '%' || REPLACE ( :p1_report_search     -- TRANSLATE would work, too
                   || '%'Watch out for the "mother is in chemotherapy" problem.
    That is, if str = 'AMY''S ORDEAL WITH CHEMOTHERAPY", and :p1_report_search = 'MY MOTHER', you'll get a match, because str contains the 2-character sibstring 'MY' and the 6-character substring 'MOTHER' in that order.
    If that's not what you want, then you can search on whiole words only, like this:
    {code}
    WHERE ' ' || REPLACE ( str
              , ' '     -- 1 space ...
              , ' '     -- ... becomes 2 spaces
         || ' ' LIKE '% ' || REPLACE ( :p1_report_search     -- TRANSLATE won't work, now
                        , ' % '     -- spaces before and after wild-card
                   || ' %'
    {code}
    This assumes that all words are delimited by spaces.
    If you want punctuation or other whtiespace (like tabs) to delimit words, that can be done, too.
    Edited by: Frank Kulash on Sep 4, 2009 2:09 PM
    Added whole-word example.

  • Case insensitive searching in Interactive Page

    Hi all,
    I am currently working on the interactive report, and wondering is it possible to perform case insensitive search for the data in the textbox besides the magnifying class.
    By the default, the system uses "=" for searching. I tried the searching option using "contains", and it would be able to search the content in uppercase and lower case scenario. Is it possible to make "contains" as the default?
    Thanks,
    Thomas.

    By the default, the system uses "=" for searching.I get "Row text contains..." as the filter when entering text directly into the default search box. Perhaps you are working with a saved report?
    There's a way to make all IR comparisons case insensitive. See this <a ref="http://apex.oracle.com/pls/otn/f?p=34839:18">example of case/accent insensitive search</a> on a standard report.
    That code can't be put in a Before Regions process as described to work with IRs as page processes are not executed by the AJAX call that refreshes the report. However, IR refreshes do run the Virtual Private Database PL/SQL call defined in the application security attributes, so putting the NLS modification code there will work.
    Go to Application > Shared Components > Edit Security Attribute | Virtual Private Database (VPD), and make the call from there. Due to the specific requirements of the code that has to be called from here when used for security purposes, this is probably best done by setting this up to make separate calls to packages defined outside APEX, one to handle any actual VPD and other security-related details, and others to orchestrate any other code that has to be run. (For example, in this case it may not be desired to alter the NLS environment on every page, so the program could take a parameter specifying the current page and apply the ALTER SESSION conditionally on this.)

  • Error in a report after enabling case insensitive search in conn pool prop

    Hi All,
    I put the below code in connection pool's connection string to enable case insensitive search.
    alter session set NLS_SORT=BINARY_CI
    alter session set NLS_COMP=LINGUISTIC
    After putting this code one of my report started giving the below error which was working fine otherwise.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. NQODBC SQL_STATE: HY000 nQSError: 10058 A general error has occurred. nQSError: 16001 ODBC error state: S1000 code: 1791 message: OracleODBCOraORA-01791: not a SELECTed expression. nQSError: 16001 ODBC error state: S1000 code: 1791 message: OracleODBCOraORA-01791: not a SELECTed expression. nQSError: 16015 SQL statement execution failed. (HY000)
    The report gives error for the below divide condition when I select a column from a different dimension (eg: region)
    COUNT(DISTINCT RMA.RMA)/COUNT(DISTINCT User."User Name")
    Can anyone please throw a light why this is happening.

    Below is the SQL which is throwing error in OBIEE. It was working fine when I tried running it in toad:
    select T1609.ATTRIB_05 as c1,
    count(distinct T1609.ATTRIB_42) as c2,
    TRUNC(T1159.FSCL_WEEK_START_DT) as c3
    from
    WC_DAY_D T1159 /* RMA_RECEIVED_DT(WC_DAY_D) */ ,
    WC_RMA_D T571,
    WC_FV_FA_D T1609,
    WC_FV_FA_F T1679
    where ( T571.ROW_WID = T1679.RMA_WID and T1159.ROW_WID = T1679.RMA_RECEIVED_WID and T1609.ROW_WID = T1679.FV_FA_WID and T1609.ATTRIB_39 <> 'FV' and (T571.STATUS_CD in ('2nd FA', '2nd FA Review', 'Closed')) and TRUNC(T1609.TODO_ACTL_END_DT) is not null and TRUNC(T1159.FSCL_WEEK_START_DT) between TIMESTAMP '2009-03-22 00:00:00' and TIMESTAMP '2009-04-12 00:00:00' )
    group by T1609.ATTRIB_05, TRUNC(T1159.FSCL_WEEK_START_DT)
    order by c3
    -------------------- Query Status: Query Failed: [nQSError: 16001] ODBC error state: S1000 code: 1791 message: [Oracle][ODBC][Ora]ORA-01791: not a SELECTed expression.
    [nQSError: 16001] ODBC error state: S1000 code: 1791 message: [Oracle][ODBC][Ora]ORA-01791: not a SELECTed expression.
    [nQSError: 16015] SQL statement execution failed.

  • Case Insensitive Search coupled with "LIKE" operator.

    Greetings All, I am running Oracle 11gR1 RAC patchet 25 on Windows X64.
    This db supports and application that requires case insensitive searches.
    Because there are a few entry points into the db I created an "after login" trigger:
    CREATE OR REPLACE TRIGGER MyAppAfterLogon_TRGR
    AFTER LOGON
    ON DATABASE
    DECLARE
    vDDL VARCHAR2(200) := 'alter session set nls_comp=''linguistic''';
    vDDL2 VARCHAR2(200) := 'alter session set nls_sort=''binary_ci''';
    BEGIN
    IF ((USER = 'MyAppUSER') OR(USER = 'MyAppREPORTINGUSER')) THEN
    EXECUTE IMMEDIATE vDDL;
    EXECUTE IMMEDIATE vDDL2;
    END IF;
    END MyAppAfterLogon_TRGR;
    This ensures that everyone connecting to the DB via any mechanism will automatically have case insensitive searches.
    Now, to optimize the know queries I created the standard index to support normal matching queries:
    select * from MyTable where Name = 'STEVE';
    The index looks like:
    CREATE INDEX "CONTACT_IDX3 ON MYTABLE (NLSSORT("NAME",'nls_sort=''BINARY_CI'''))
    This all works fine, no issues.
    The problem is when I write a query that uses the "LIKE" operator:
    select * from MyTable where Name like 'STEV%';
    I get back the record set I expect. However, my index is not used? I can't for the life of me get this query to use an index.
    The table has about 600,000 rows and I have run gather schema stats.
    Does anyone know of any issues with case insensitive searches and the "LIKE" clause?
    Any and all help would be appreciated.
    L

    I think there is issue with your logon trigger :
    "IF ((USER = 'MyAppUSER') OR(USER = 'MyAppREPORTINGUSER')) THEN"
    it should be :
    IF UPPER(USER) = 'MYAPPUSER' OR UPPER(USER) = 'MYAPPREPORTINGUSER' THEN
    because user name stored in Upper case. Check and try.
    HTH
    Girish Sharma

  • Case insensitive search working in dev but not in prod

    Hello All,
    I had set the CASE_SENSITIVE_CHARACTER_COMPARISON parameter as OFF in NQSConfig.ini file for enabling the case insensitive search in OBIEE.
    This setup is letting me do the case insensitive search in Dev env but the same doesnt work in prod env. I tried pointing both prod and dev rpd to same prod db.
    With same db also, case insensitive search doesnt work in prod env.
    Any idea for which other configuration I can look for.
    Thanks in advance.

    Thanks Stijin. I had seen this post earlier. Case insensitive search works fine after setting the value for NLS_SORT and NLS_COMP in production RPD but the other report with distinct clause starts failing. Not sure about the reason.
    Saw this comment from you in that post:
    The only compromise solution we could find was to "cache" the column value we wanted to use in insensitive searches. These were mainly used in "show all choices" while setting prompts. Other than that there isn't much you can do in an Oracle database.
    Can you please tell me how to implement the above.

  • Accent insensitive LIKE in a stored procedure

    Hi!
    How is it possible to run a SELECT with accent insensitive LIKE in a stored procedure?
    ALTER SESSION SET NLS_COMP=xxx is not allowed in procedure body, so what can be done?
    I guess i need the LIKE equivalent of NLSSORT(string, 'NLS_SORT = XDanish_ai').
    Is there such a thing?
    I need this option per statement, not globally.
    I use Oracle 11g.
    Regards,
    David

    I used this approach:
    procedure proc1(
         p_1 IN VARCHAR2,
         p_out OUT sys_refcursor)
    is
         m_comp VARCHAR2(80);
         m_sort VARCHAR2(80);
    begin
         select value into m_comp from NLS_SESSION_PARAMETERS where parameter='NLS_COMP';
         select value into m_sort from NLS_SESSION_PARAMETERS where parameter='NLS_SORT';
         execute immediate 'ALTER SESSION SET NLS_COMP=LINGUISTIC';
         execute immediate 'ALTER SESSION SET NLS_SORT=Slovenian_ai'; -- I'm not danish ;)
         open p_out for
         select * from table_a where name like p_1 order by name;
         execute immediate 'ALTER SESSION SET NLS_COMP=' || m_comp;
         execute immediate 'ALTER SESSION SET NLS_SORT=' || m_sort;
    end;This works, but:
    - the NLS affects also ordering, which I don't want
    - it does not count 'z' and 'ž' as the same, which was the goal I tried to achieve ...

  • Doing case insensitive search

    Is there any performant way to do case insensitive searches within the database other than using upper on the column?
    If I use upper(col name) the index on the column is bypassed and hence this effects performance.
    Is there any other way to do this.
    Thanks
    Vandana

    In 10g rel.2 :
    alter session set nls_comp=linguistic;
    Execute your query; it should work for text search case insensitive
    You can also use regular expression function like regexp_like() with match_option set to ‘i’:
    select ename
    from emp
    where regexp_like(ename, ‘k’, ’i’);
    Best Regards
    Krystian Zieja / mob

  • Pattern Matching Accent Insensitive

    I am using the Pattern Matcher class in order to do regex matching.
    Is there a way to specify accent insensitive matching.
    I have a string aeihAEIH������
    when searching for ei
    I would like to get 4 matches
    1) ae
    2) AE
    3) ��
    4) ��
    However, I only get 1) & 2)
    Here is my code:
    Matcher matcher = Pattern.compile("ae", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE).matcher("aeihAEIH������")
    Is there a way to accomplish this?

    ehirsch wrote:
    I do not want to explicity specify the accented characters in code.
    I want that ae should match also against accented characters of any type unlimited.AFAIK, that is not possible. However, I am a mere grasshopper in the regex-world. If my assumptions are incorrect, I am sure I will be corrected by the regex-lords that roam these forums.

  • Accent Insensitive

    Hi, how can i create a index in Azure Search that is accent insensitive?
    What i want is that the search for the word "João" return the same results than searching for "Joao".
    What about stopwords?

    Hi, how can i create a index in Azure Search that is accent insensitive?
    What i want is that the search for the word "João" return the same results than searching for "Joao".
    What about stopwords?
    Hi guys... I Have found the link http://azure.microsoft.com/en-us/documentation/articles/search-api-2015-02-28-preview/#LanguageSupport/ and was abble to solve the problem.
    Very good!!!
    Tnks!

  • Possible to do case-insensitive searches?

    G'day,
    I was wondering if it's possible to do case-insensitive searches in oracle/HTMLDB?
    I've tried what I thought would work
    "select * from application where name like '%microsoft%'", this unfortunately doesn't return any records with a capital in it(eg "Microsoft").
    If there is no way to do case-insensitive searches what is the best way around it?
    Thanks
    -Colin

    Colin,
    Yes it is possible to do case insensitive searches using SQL. Try, for example:
    select * from application where upper(name) like '%ORACLE%'
    The trick is to upper() both sides of the like operator.
    Sergio

  • Case insensitive search in SE16

    Hello Community,
    We have a Z table which contains the field "filename," containing both upper & lowercase alphanumeric values. 
    I was surprised to find that it is not so easy to perform a case insensitive search against those field values using SE16.
    It would be perfect if:
       1. a search in SE16 for `file.txt` will find the results of all records related to the file "file.txt"
       2. a search in SE16 for `FiLe.TxT` will also find all records related to the file "file.txt"
    Can someone help me to accomplish this ?
    Thanks!
    Keith Helfrich

    Hi everyone,
    The goal is to perform a case insensitive search in SE16.  Is there no way to do this ?
    While there are a variety of work-arounds, for example : it is possible to store all the values in the table in UPPERCASE, these work-arounds do not solve our problem. 
    The values in the table need to be stored with the accurate case, exactly as the file is named at the UNIX level.  Since UNIX is also case sensitive, we need to be accurate with the case when storing statistics data about the files. 
    Yet, when searching in SE16, it is problematic because we don't always know the correct case.  For that reason, a case insensitive search is required.
    This seems to be a very basic function that I am surprised SAP doesn't provide...

  • Case Insensitive search and "IN" Clause - Open SQL

    Hi,
    I have some doubts regarding Open SQL:
    Is there any support for Case Insensitive Search in Open SQL, is it availabe by default?
    Is there any restriction on number of elements in "IN" Clause, in Open SQL, is there any default number?
    I have checked the [Open SQL Grammer|http://help.sap.com/saphelp_nwce711/helpdata/en/9b/f46cabaa874bc9a82234e8cf1d0696/frameset.htm] also, but nothing found there.
    Thanks,
    Piyush
    P.S I didn't find any other appropriate place to post this thread, let me know the correct categorization of Open SQL in case its wrong.

    Is there any support for Case Insensitive Search in Open SQL, is it availabe by default?
    When you are querying any strings, it is always case sensitive.
    Is there any restriction on number of elements in "IN" Clause, in Open SQL, is there any default number?
    I don't think there area any. IN opearator works like combined ORs and here you don't have any restrictions in fields number.
    Regards
    Marcin

Maybe you are looking for

  • Problems with Adobe account and Adobe support!

    We bought in December 2012 "Creative Cloud for teams" (10 licenses). I have since started our problems with support Adobe that continue today: ( 1. We do not receive invoices by e-mail - every month we have to ask several times adobe support on the c

  • 2 ipads and neither will charge after ios 8.02 update

    We have an iPad 2 and an iPad 3 and updated them both from whatever version of 7 we were running to 8.02 last night. Now neither will charge. I've done hard restarts on both of them. I've tried both Apple chargers and different outlets. I've tried co

  • 2911 ISM-SRE-300 CUE 8.6.7 install failure...Verifying ... Invalid signature in command line file !!

    ISM-SRE-300 seems to be a loop at boot with Verifying ... Invalid signature in command line file Any ideas? Log Install of ftp://*****:*****@10.100.64.21/cue-vm-k9.SPA.sme.8.6.7.pkg in progress Install status : Waiting for RBIP registration No locals

  • How do I get set up to use RoboHelp 10?

    It says it cannot detect my internet connection.  I am online. I tried to activate using an offline process but need a request code. There was no request code generated.

  • Clearbox Lightbox, text alignment

    Hi experts! I have this problem I need some help with. I want my text below the pictures which works fine, but as soon as I add more thumbnails and get multiple rows the textbox doesnt follow, but stays put, so it shows on top of the thumbnails. I wo