Case insensitive search and index

I have to execute a case insentitive search.
I created this index on a not null field:
create index indx_prova on
table (nlssort(campo, 'NLS_SORT=BINARY_CI'));
The select is:
select * from tabella where campo like 'A storage%'
This select should retrive 5 records:
A storage ring for crystalline beam studies
a storage ring for crystalline beam studies
A Storage Ring for Crystalline Beam Studies
A storage ring for crystalline beam studies
A storage ring for crystalline beam studies
Instead I got only 3 records:
A storage ring for crystalline beam studies
A storage ring for crystalline beam studies
A storage ring for crystalline beam studies
So The query isn't case insensitive.
I can't set nls_sort=BINARY_CI and nls_comp=LINGUISTIC at level session.
Is there a solution.
Am I doing something wrog?

I set alter session set nls_comp=LINGUISTIC; alter session set nls_sort=BINARY_CI;
I create this index:
create index titolo_indx on
table (nlssort(campo, 'NLS_SORT=BINARY_CI'));
If I execute this query:
select * from ri01_prodotti where titolo like 'A storage ring f%'
Oracle doesn't user the index.
SQL_ID 7yvspnyf96vp8, child number 0
select * from ri01_prodotti where titolo like 'A storage ring%'
Plan hash value: 350479533
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 2020 (100)| |
|* 1 | TABLE ACCESS FULL| TABLE | 1 | 1365 | 2020 (1)| 00:00:25 |
Predicate Information (identified by operation id):
1 - filter("CAMPO" LIKE 'A storage ring%')
If I execute a query with =, oracle use index.
select * from table where campo ='A storage ring for crystalline beam studies'
SQL_ID 5jzr5nm6b37pq, child number 0
select * from ri01_prodotti where titolo ='A storage ring for crystalline beam
studies'
Plan hash value: 3866031381
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 151 (100)| |
| 1 | TABLE ACCESS BY INDEX ROWID| RI01_PRODOTTI | 377 | 502K| 151 (0)| 00:00:02 |
|* 2 | INDEX RANGE SCAN | TITOLO_INDX | 151 | | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("RI01_PRODOTTI"."SYS_NC00078$"=HEXTORAW('612073746F726167652072696E6720
666F72206372797374616C6C696E65206265616D207374756469657300') )

Similar Messages

  • Case insensitive search and replace using ASP and Oracle database

    I am interested in providing a case insensitive search and replace query in a Active server page. At present data is collected from a html form which passes the text values to a ASP page. The ASP page runs a search (select query) to find if the data is already in the Oracle database, if it isn't the ASP page runs sql (INSERT) to insert the record, if not the page returns a form indicating that the record already exists. At present we can convert the case of new records using the VB UCase() function. But can't do a insensitive search with the existing records. *The Query must be able to utilize ASP variables.
    Any help would be much appreciated.
    David Cheryk
    null

    I can't check your script right now since I'm not on Mac. I recommend you to use FindChangeByList script for CS4 instead (it works with CS3): http://forums.adobe.com/servlet/JiveServlet/download/2080627-12695/FindChangeByListCS4.zip together with Martin Fisher's: http://www.kasyan.ho.com.ua/downloads/RecordFindChange_CS3_Kas.zip
    Use this script to record settings from Text and GREP tabs, then copy and paste them into FindChandgeList.txt file.
    Or, optionally you can use this script: http://www.kasyan.ho.com.ua/find_change_by_queries.html.
    Kasyan

  • Case insensitive search and "IN" Clause in 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.

    > I have some doubts regarding Open SQL:
    I believe that you've questions and not doubts...
    > - Is there any support for Case Insensitive Search in Open SQL, is it availabe by default?
    Nope, there is nothing like that. By default all supported database use a bytewise equal operator - case insensitivness needs to be programmed by hand.
    E.G. using UPPER(x)/LOWER(x) functions.
    Be aware that this disables the possibilities of index usage.
    > - Is there any restriction on number of elements in "IN" Clause, in Open SQL, is there any default number?
    Yes, there is a restriction and it differes between the different DBMS.
    Until recently you could have 2000 variables per statement with MaxDB.
    The current versions of DBSL and MaxDB Kernel now support up to 10000 variables per statement.
    Anyhow, in most cases, such a long in list can and should be avoided by using the FOR ALL ENTRIES construct. With this, the DBSL automatically splits the long IN list into smaller chunks and executes the statements several times.
    This is invisible to the ABAP report - it just gets the result set as usual.
    > 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.
    I guess in anyone of the DB forums is Ok.
    regards,
    Lars

  • 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

  • Support for Case Insensitive Search and IN Clause in 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.

    No cross posting.
    Read the "Rules of Engagement"
    Regards
    Juan

  • 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

  • Phonetic and case insensitive searches in Oracle

    Hi,
    Do you know if Oracle 9i allows phonetic searches ? I've found several solutions for case insensitive searches, but I'd need phonetic searches too (like 'había' vs. 'havia' vs. 'habia', etc)
    Any comment would be really welcome.
    Thanks in advance,
    Juan

    lookup soundex in the SQL Reference guide.

  • Case-Insensitive Searching on Content Server

    Hello everyone,
    I have a Content Server 10gr3 using an Oracle 11g DB. All of my searches are case sensitive, but we need case-insensitive searching. I've tried changing the DatabasePreserveCase variable in the config.cfg to 1, 0, true, and false, rebuilt the indexes in between each reboot (not sure if that's necessary or not), tried checking in new documents after making the changes and searching for those, but no matter, searches stay case sensitive.
    We have another UCM install running on a 10.2.0.3.0 DB, and case insensitivity works on that Content Server with DatabasePreserveCase=1.
    What could we be doing wrong? I've found several documents which have stated that case-insensitivity is impossible with an Oracle DB, but I think those are all old and from before Oracle's acquisition of the product (and obviously it is possible, since we have another install with it working).
    Thanks in advance for any help you can give!

    I'm not quite sure what you mean by Search Engine... we simply installed the Oracle 11g Database, then installed Content Server and configured it to run using that database. We haven't done anything with full-text search.
    Edit: Do you mean the SearchIndexerEngineName value in the config file? It's DATABASE.METADATA, though at some point we also need to get full-text up and running which to my understanding requires it to be DATABASE.FULLTEXT.
    As to the OracleCaseInsensitiveSearch component, where can I find it? Google shows up nothing, and MetaLink has one page saying that it exists but nothing more...
    Message was edited by:
    user573973

  • SAP JPA - case-insensitive search

    Hi there, is it possible to have a case-insensitive search with SAP JPA? The keywords UPPER, LOWER aren't available in the query (OpenSQL limitation I guess).
    The only way I see is to create a duplicates columns for the search relative atributes and make the data upper or lower case before save. May be there is another options? More suitable and elegant?

    Hi,
    you may bypass openSQL by native queries.
    Make sure that you use the hint described in
    http://help.sap.com/saphelp_nwce72/helpdata/en/4a/0cf02870c540caab611d56220ec0cb/frameset.htm
    together with createNativeQuery.
    But anyway, the approach with duplicates columns enables you to create indexes on these UPPER columns. It is not too bad.
    Regards,
    Rolf

  • 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

  • GetOrdinal of AseDataReader Class is not doing case-insensitive search

    hi,
    I am working on 12.5.4 version of sybase ASE.I am using 'Sybase.AdoNet2.AseClient.dll' to connect with database. I am using GetOrdinal method of ASEDatareader class (that as per documentation performs a case-sensitive lookup first. If it fails , a second search that is case-insensitive occurs) but in my case it is not performing case-insensitive search. I am attaching the document for your reference.
    http://infocenter.sybase.com/help/index.jsp?topic=/com.infocenter.dc20066.1570100/doc/html/san1364409576274.html
    Thanks,
    Raman

    Hi Monica,
    Another thing you want to make sure is on your ASE that the oledb/adonet MDA scripts are up to snuff. Some of our fixes in the driver are in this.
    If you login into the ASE and get the output of sp_version.
    You should get something like this:
    OLEDB MDA Scripts
             15.7.0.1250.1013/Wed Feb 19 UTC 00:28:47 2014
    The ado.net driver and the older oledb driver use some specific MDA scripts on the ASE.
    Read the coverletter of the SDK (Software Developers Kit for ASE). It explains how to update the MDA scripts. They are on the client side $sybase\ADONET\sp.
    So where you downloaded the SDK you want to click Info then look for the README.
    This is all the SDKs:
    * Updating the metadata stored procedures required by ODBC, OLE DB and
      jConnect Drivers on Adaptive Server Enterprise
      Certain new features and bug fixes in ODBC, OLE DB and jConnect drivers
      require you to modify the metadata stored procedures in Adaptive Server.
      These stored procedures may not be up-to-date on your host ASE server due
      to various reasons.
      If the metadata stored procedures are outdated, you may not be able to use
      some of the fixes that are implemented in this SP/ESD, so you will need to
      manually install the updated metadata stored procedures.
      To update the metadata stored procedures in Adaptive Server, first determine
      the version of the meta-data scripts installed on the ASE. To do so, execute
      the following command:
      sp_version
      go
      The version number of the ODBC, OLE DB and jConnect meta-data scripts will
      be displayed.
      Review the version number column and compare it against the version of the 
      driver being used.
      If the metadata scripts are outdated, the version installed will be older
      than the driver build number or you will encounter one of the following:
      - stored procedure sp_version is not found
      - the stored procedure output does not print a row for the driver
      The updated scripts are included with the drivers and can be installed as
      follows:
      For ODBC & OLE DB:
      - Go the "sp" directory under the ODBC/OLE DB installation directory
      - Execute the install_odbc_sprocs script for the ODBC Driver and
      install_oledb_sprocs script for OLE DB Provider.
      Syntax for using the script is:
            install_[odbc/olebd]_sprocs <ServerName> <username> [<password>]
             where <ServerName> is the name of the Adaptive Server
                 <username> is the username to connect to the server
                 [<password>] is the password the username
                 (don’t supply this for null password)
      For jConnect:
      - Go to the "sp" directory under the jConnect installation directory. Based
      on your host ASE server version, choose the appropriate SQL script.
      - Use isql or another tool of your choice to execute the selected script.
      This will install the current meta-data stored procedures.
    Thanks,
    Dawn

  • WCC Case Insensitive Search

    Hello everyone,
    I am using OOTB DATABASE.METADATA as the search engine.
    I wanted to know how to make it case insensitive search.
    thanks

    Hey Jiri,
    thanks for the quick answer, I had to use Oracle Text Search.
    to switch the search engine i added the following two entries in config.cfg
    SearchIndexerEngineName=OracleTextSearch
    MaxIndexableFileSize=0
    bounce UCM and recreated indexes.
    and i could make them case insensitive on WCC.
    for WCCIMG i also had to make my applications full text before the searches were made case insensitive.
    thanks

  • What is the best way to do a case insensitive search?

    Hi Guys,
    hopefully a quick one, anyone know what the best way to perform a case-insensitive search is? at the moment many of our stored procedures perform selects against un-indexed fields (e.g. product title) and to avoid casing problems we have an UPPER around the field name and the variable e.g.
    AND (nvcproducttitle IS NULL OR
    UPPER(p.NVCTITLE) LIKE '%' || UPPER(nvcproducttitle) || '%')
    This seems to work just fine but on a large catalogue (10 million+) it can take 50-60 seconds to return.
    Any pointers would be appreciated,
    J

    user7186902 wrote:
    Hi Guys,
    hopefully a quick one, anyone know what the best way to perform a case-insensitive search is? at the moment many of our stored procedures perform selects against un-indexed fields (e.g. product title) and to avoid casing problems we have an UPPER around the field name and the variable e.g.
    AND (nvcproducttitle IS NULL OR
    UPPER(p.NVCTITLE) LIKE '%' || UPPER(nvcproducttitle) || '%')
    This seems to work just fine but on a large catalogue (10 million+) it can take 50-60 seconds to return.
    Any pointers would be appreciated,
    JYou could either ensure you have a function based index for your column e.g.
    create or replace index fn_idx on prodtable (upper(nvctitle));
    nb. syntax not checked
    or you could use regular expressions. REGEXP_LIKE allows for case insensitive like searches.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions007.htm#SQLRF00501

  • 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 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.

Maybe you are looking for

  • Is there any Macpro that plays well with FCPX?

    Is there a Macpro out there that plays 3 cam 1920 x 1080 Pro Res multicam perfectly without dropping frames and still plays perfectly without rendering for things like dissolves?   My late model Imacs do this perfectly even with slow Lacie drives, bu

  • Syncing Genius Mixes not supported?

    Before turning on iTunes Match, I was able to sync Genius Mixes from within the device's MUSIC tab in iTunes. I cannot find this functionality anymore with iTunes Match. Am I missing something?

  • Copying all birthdates from custom field to regular addressbook field

    is there a way i can copy birthdates from a custom field to regular address book field? my current birthdates are not reflecting in iCal - and while there is are solutions to copying custom dates to ical, i would rather work on the solution to copy t

  • Upgrade in hangs in XPRAS_UPG phase

    We are experimenting an hang situation during the upgrade from 46C sandbox system to ECC6 Sr3, latest patches. The upgrade is in phase XPRAS_UPG, and in Sap we see the job RDDEXECL running from very long time (more than 1 days); in SM50 we see the se

  • HDD Camcorder Sony XR520E mpg not recognized

    Hi, I just purchased the Final Cut Pro X hoping to work with my large quantities of mpg files imported from my Sony HDD based camcorder. I have a lot of mpg (SD) format and some AVCHD format, but when I tried to import from camcorder, Final Cut Pro o