Case Insensitive Indexes

In relation to switching on case insensitive queries using
alter session set NLS_COMP=LINGUISTIC;Can anyone answer the following?
>
Yes, it works.... but I can't for the life of me figure out how to build a linguistic index that the LIKE clause will actually use. Building an index thus, for example:
create index bin_ai on names(NLSSORT("NAME",'nls_sort=''BINARY_AI'''));
makes an index which does get used to good effect by queries such as
select name from names where name = 'Johny Jacobson';
but not by
select name from names where name like 'Johny%';
Hence, in a real-world test with 100,000 records, the LIKE query runs about 100 times slower than the '=' query (3 sec compared to 0.03 sec). Not very scalable. Is there a way to speed this up??
Also is it possible to set session variables such as nls_comp on a database/schema/user level?

Hi,
select name from names where name like 'Johny%';Performance when using the SQL "like" clause can be tricky because the wildcard "%" operator can invalidate the index. For example a last_name index would be OK with a "like 'SMI%'" query, but unusable with "like '%SMI%'.
One obscure trick for indexing queries "like '%SON'" is to create a REVERSE index and them programmatically reverse the like clause to read "like 'NOS%'", effectively indexing on the other side of the text.
You might want to look at Oracle*text indexes, if your database has low DML:
http://www.dba-oracle.com/oracle_tips_like_sql_index.htm
If you are 10gr2:
Oracle 10g release 2 has now introduced a case insensitive search method for SQL that avoids index invalidation and unnecessary full-table scans. You can also employ Oracle text indexes to remove full-table scans when using the LIKE operator. Prior to Oracle10g release 2 case insensitive queries required special planning:
1 - Transform data in the query to make it case insensitive (note that this can invalidate indexes without a function-based index):
create index upper_full_name on customer ( upper(full_name));
select full_name from customer
where upper(full_name) = 'DON BURLESON';
2 - Use a trigger to transform the data to make it case insensitive (or store the data with the to_lower or to_upper BIF.
3 - Use Alter session commands:
alter session set NLS_COMP=ANSI;
alter session set NLS_SORT=GENERIC_BASELETTER;
select * from customer where full_name = 'Don Burleson'
Hope this helps. . .
Don Burleson
Oracle Press author

Similar Messages

  • 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') )

  • Case INSENSITIVE Columns on Oracle

    Hello Friends,
    Good Monday for everyone....
    I would like to ask you guys if there is a way to create a case INSENSITIVE Columns on Oracle. I used on Sqlserver before the COLLATE sintax, and I was able to make a columns (just that one) INSENSITIVE.
    I'm using oracle 10gr2 on Windows plataform and herte is my nls_parameters. My ideia is to search on this column without the need of performing a function UPPER and LOWER and etc...
    NLS_LANGUAGE BRAZILIAN PORTUGUESE
    NLS_TERRITORY BRAZIL
    NLS_CURRENCY Cr$
    NLS_ISO_CURRENCY BRAZIL
    NLS_NUMERIC_CHARACTERS ,.
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD/MM/RR
    NLS_DATE_LANGUAGE BRAZILIAN PORTUGUESE
    NLS_CHARACTERSET WE8MSWIN1252
    NLS_SORT WEST_EUROPEAN
    NLS_TIME_FORMAT HH24:MI:SSXFF
    NLS_TIMESTAMP_FORMAT DD/MM/RR HH24:MI:SSXFF
    NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR
    NLS_TIMESTAMP_TZ_FORMAT DD/MM/RR HH24:MI:SSXFF TZR
    NLS_DUAL_CURRENCY Cr$
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    tks a lot
    Keen

    APC wrote:
    No, they mean a setting which makes "APC" or "apc" match "Apc".
    There is nothing to be done on 10g, other than building a function based index on the column in question, so that any UPPER() searches are optimized.
    Well, as Kamran Agayev already noted CI is available in 10g too. It also worth mentioning FBI creates a hidden column. Also, your statement
    In 11g we have the option to set the NLS_SORT parameter so that any searches are case-insensitive (or indeed accent insensitive). Find out more.
    is incomplete. NLS_SORT affects nothing but sort:
    SQL> connect scott
    Enter password: *****
    Connected.
    SQL> select * from v$version
      2  /
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    order by name
    12  /
    NAM
    Joe
    Max
    Sam
    joe
    max
    sam
    6 rows selected.
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    where name = 'max'
    12  /
    NAM
    max
    SQL> alter session set nls_sort = binary_ci
      2  /
    Session altered.
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    order by name
    12  /
    NAM
    Joe
    joe
    max
    Max
    Sam
    sam
    6 rows selected.
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    where name = 'max'
    12  /
    NAM
    max
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    where name like 'm%'
    12  /
    NAM
    max
    SQL> select 'Max' name from dual union
      2  select 'max' name from dual
      3  /
    NAM
    Max
    max
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  distinct name
    10    from  t
    11  /
    NAM
    sam
    Joe
    joe
    max
    Sam
    Max
    6 rows selected.
    SQL> As you can see, NLS_SORT alone works on sort but not on "searches". We also need to set NLS_COMP, which by default is BINARY. Prior to 10g R2 (I am not 100% sure, it could be prior 10g), the only NLS_COMP choice, besides BINARY, was ANSI. However, ANSI does not work with all comparison operators (e.g. does not work for LIKE, UNION, DISTINCT):
    SQL> alter session set nls_sort = binary_ci
      2  /
    Session altered.
    SQL> alter session set nls_comp=ansi
      2  /
    Session altered.
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    order by name
    12  /
    NAM
    Joe
    joe
    max
    Max
    Sam
    sam
    6 rows selected.
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    where name = 'max'
    12  /
    NAM
    Max
    max
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    where name like 'm%'
    12  /
    NAM
    max
    SQL> select 'Max' name from dual union
      2  select 'max' name from dual
      3  /
    NAM
    Max
    max
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  distinct name
    10    from  t
    11  /
    NAM
    sam
    Joe
    joe
    max
    Sam
    Max
    6 rows selected.
    SQL> Starting 10g R2 NLS_COMP can be set to LINGUISTIC, which will also work for LIKE and UNION but not for DISTINCT:
    SQL> alter session set nls_sort = binary_ci
      2  /
    Session altered.
    SQL> alter session set nls_comp=linguistic
      2  /
    Session altered.
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    order by name
    12  /
    NAM
    Joe
    joe
    max
    Max
    Sam
    sam
    6 rows selected.
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    where name = 'max'
    12  /
    NAM
    Max
    max
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  name
    10    from  t
    11    where name like 'm%'
    12  /
    NAM
    Max
    max
    SQL> select 'Max' name from dual union
      2  select 'max' name from dual
      3  /
    NAM
    Max
    SQL> with t as (
      2             select 'Max' name from dual union all
      3             select 'sam' name from dual union all
      4             select 'Joe' name from dual union all
      5             select 'max' name from dual union all
      6             select 'joe' name from dual union all
      7             select 'Sam' name from dual
      8            )
      9  select  distinct name
    10    from  t
    11  /
    NAM
    sam
    Joe
    joe
    max
    Sam
    Max
    6 rows selected.
    SQL> However even LINGUISTIC does not work with:
    • CLOB or NCLOB data types
    • Object data types
    • Table partitions
    • Index-organized tables
    SY.

  • 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 mode by jbo:DataQuery

    I'm working on a BC4J JSP project. I cannot find a way to search in the case insensitive mode. I'm using JDeveloper 9.0.3.1. I looked in the DataQueryComponent.jsp, the xxxx_Query.jsp, and all the files generated under the ViewObject to find a way to accomplish this but no luck. Please advise. Thank you.

    One thing you can do is modify the query handler. If it's a straight JSP app (no uix/struts) you are probably using DataHandler.jsp for you handling. If this is the case, you can modify the OnEvent section for Search and Add Criteria. They should look like this
    <jbo:OnEvent list="Search, Add Criteria" >
    <% String rowParam = params.getParameter("nRows");
    int nRows = 0;
    if (rowParam != null)
    try { nRows = Integer.parseInt(rowParam); }
    catch (Exception ex) { }
    %>
    <jbo:ViewCriteria id="vc" datasource="ds" action="new">
    <% for (int index=0; index < nRows; index++)
    String criteriaRowId = "row" + index;
    %>
    <jbo:CriteriaRow id="<%=criteriaRowId%>" >
    <jbo:AttributeIterate id="attrvc" datasource="ds" queriableonly="true">
    <% String item = attrvc.getName();
    String value = params.getParameter("row" + index + "_" + item);
    %>
    <jbo:Criteria dataitem="<%=item%>" value="<%=value%>" />
    </jbo:AttributeIterate>
    </jbo:CriteriaRow>
    <% } %>
    </jbo:ViewCriteria>
    </jbo:OnEvent>
    I added a line just about the <jbo:Criteria> line that converts the value to uppercase like this:
    if (value !=null) { value=value.toUpperCase(); }
    Hope that helps!

  • 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

  • Make oracle database case insensitive

    Hi All,
    I am using oracle 10g EE as my back end database and front end is in C# .NET. I want to make my oracle database to perform any comparison case insensitively. I searched on the net and found several ways to achieve that
    1. using upper function in procedures - can't afford
    2. function index - can't afford
    3. setting the session parameters
    ALTER SESSION SET NLS_COMP=ANSI;
    ALTER SESSION SET NLS_SORT=BINARY_CI;
    The 3rd looks promising and can save lot of time. I have several question
    1. Is there any way I can set these parameters from .NET?
    2. Is there any way I can set once and will make only my database case insensitive?
    any link, reference is highly appreciated.
    Thanks,

    user10768079 wrote:
    Thanks for your mail.
    I want to apply these settings to my oracle database only. It should not affect other oracle database that exist with my db.
    Thanks,It would make sense to issue "ALTER SESSION" statements during logon process from the .NET code instead of changing the entire database - which might affect other users. Judging by the way you have written this, I feel you are referring to a schema rather than database.
    .NET surely has the capability to run "ALTER SESSION" statements.

  • ADF table: case-insensitive sorting

    I have an <af:table> that uses a SortableModel as it's data source. I have sorting enabled on the table, but it's sorted according to case sensitivity.
    My data source has mixed case, and I'd like to be able to sort regardless of case. Is there anyway to change the behavior so it does a case-insensitive sort instead?
    Thanks

    In case anyone else is looking for this, I went ahead and wrote an extension of CollectionModel that performs a case insensitive sort on String objects. I'm posting it here in the hopes it will help others in the same jam I was. It would really have been helpful if Oracle had made the source code to SortableModel available. I hope I did things properly with the rowKey stuff since there are no examples to work from.
    Anyway, here it is:
    package com.fhm.mwb.ui.model;
    import oracle.adf.view.faces.model.CollectionModel;
    import oracle.adf.view.faces.model.SortCriterion;
    import org.apache.commons.beanutils.BeanComparator;
    import org.apache.commons.collections.comparators.ComparableComparator;
    import org.apache.commons.collections.comparators.ComparatorChain;
    import java.io.Serializable;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.List;
    import javax.faces.FacesException;
    import javax.faces.model.DataModelEvent;
    import javax.faces.model.DataModelListener;
    * This class provides a sortable data model that uses case insensitive sort order when processing
    * String objects.  All other objects in the data must implement Comparable and are sorted using
    * Comparable.compare().
    public class CaseInsensitiveSortableModel extends CollectionModel {
        private static BasicComparator _comparator = new BasicComparator();
         * Default constructor.
        public CaseInsensitiveSortableModel() {
         * Construct on top of a list of data.
         * @param list List of data to wrap in the model
        public CaseInsensitiveSortableModel(List list) {
            setWrappedData(list);
         * Set the sort criteria for this model
         * @param criteria List of SortCriterion objects
        public void setSortCriteria(List criteria) {
            _sortCriteria = criteria;
            if((criteria != null) && (criteria.size() > 0)) {
                // Sort our model data using this new criteria
                ComparatorChain chain = new ComparatorChain();
                for(int i = 0; i < criteria.size(); i++) {
                    SortCriterion crit = (SortCriterion) criteria.get(i);
                    chain.addComparator(new BeanComparator(crit.getProperty(), _comparator),
                        !crit.isAscending());
                List list = (List) getWrappedData();
                Collections.sort(list, chain);
                setWrappedData(list);
            } else {
                // Clear out our sort order
                _sortCriteria = new ArrayList();
         * Get the current sort criteria.
         * @return List of sort criteria
        public List getSortCriteria() {
            return _sortCriteria;
         * Determine if a given column is sortable.
         * @param column Name of the column to test
         * @return boolean true if the column is sortable
        public boolean isSortable(String column) {
            return true;    // Everything is sortable for now
         * Sets up a value at a particular rowKey to be the current value. The current value
         * is returned by calling {@link #getRowData}.
         * @param rowKey the rowKey of the value to make current. Use null to clear the current value.
        public void setRowKey(String rowKey) {
            if(rowKey == null) {
                setRowIndex(-1);
            } else {
                setRowIndex(Integer.valueOf(rowKey).intValue());
         * Gets the rowKey of the current value. The current value is returned by
         * calling {@link #getRowData}.
         * @return the rowKey of the current value, or null if there is no current value
        public String getRowKey() {
            return isRowAvailable() ? String.valueOf(_rowIndex) : null;
         * Set the list data we are wrapping
         * @throws ClassCastException if data is
         *  non-null and is not a List
        public void setWrappedData(Object data) {
            _wrappedList = (List) data;
            if(_wrappedList == null) {
                setRowIndex(-1);
         * Return the object representing the data wrapped by this model, if any.
        public Object getWrappedData() {
            return _wrappedList;
         * Return true if there is wrappedData
         * available, and the current value of rowIndex is greater
         * than or equal to zero, and less than the size of the list.  Otherwise,
         * return false.
         * @exception FacesException if an error occurs getting the row availability
        public boolean isRowAvailable() {
            return ((_rowIndex < 0) || (_rowIndex > getRowCount())) ? false : true;
         * If there is wrappedData available, return the
         * length of the list.  If no wrappedData is available,
         * return -1.
         * @exception FacesException if an error occurs getting the row count
        public int getRowCount() {
            return (_wrappedList == null) ? (-1) : _wrappedList.size();
         * If row data is available, return the list element at the index
         * specified by rowIndex.  If no wrapped data is available,
         * return null.
         * @exception IllegalArgumentException if now row data is available
         *  at the currently specified row index
        public Object getRowData() {
            if(_wrappedList == null) {
                return null;
            } else if(!isRowAvailable()) {
                throw new IllegalArgumentException("No row data available");
            } else {
                return wrappedList.get(rowIndex);
         * Return the zero-relative index of the currently selected row.  If
         * we are not currently positioned on a row, or no wrappedData
         * is available, return -1.
         * @exception FacesException if an error occurs getting the row index
        public int getRowIndex() {
            return _rowIndex;
         * Set the zero-relative index of the currently selected row, or -1
         * to indicate that we are not positioned on a row.  It is
         * possible to set the row index at a value for which the underlying data
         * collection does not contain any row data.  Therefore, callers may
         * use the isRowAvailable() method to detect whether row data
         * will be available for use by the getRowData() method.
         * If there is no wrappedData available when this method
         * is called, the specified rowIndex is stored (and may be
         * retrieved by a subsequent call to getRowData()), but no
         * event is sent.  Otherwise, if the currently selected row index is
         * changed by this call, a {@link DataModelEvent} will be sent to the
         * rowSelected() method of all registered
         * {@link DataModelListener}s.
         * @param rowIndex The new zero-relative index (must be non-negative)
         * @exception FacesException if an error occurs setting the row index
         * @exception IllegalArgumentException if rowIndex
         *  is less than -1
        public void setRowIndex(int rowIndex) {
            if(rowIndex < -1) {
                throw new IllegalArgumentException("Row index must be >= 0");
            int old = _rowIndex;
            _rowIndex = rowIndex;
            if(_wrappedList == null) {
                return;
            DataModelListener[] listeners = getDataModelListeners();
            if((old != _rowIndex) && (listeners != null)) {
                Object rowData = null;
                if(isRowAvailable()) {
                    rowData = getRowData();
                DataModelEvent event = new DataModelEvent(this, _rowIndex, rowData);
                int n = listeners.length;
                for(int j = 0; j < n; j++) {
                    if(null != listeners[j]) {
                        listeners[j].rowSelected(event);
        private List _wrappedList = new ArrayList();
        private List _sortCriteria = new ArrayList();
        private int _rowIndex = -1;
         * Internal class to provide a general Comparator that treats Strings in a case
         * insensitive manner.  All other types are assumed to be instances of Comparable
         * and handled as such.
        private static class BasicComparator implements Comparator, Serializable {
            private static final Comparator INSENSITIVE_COMPARATOR = String.CASE_INSENSITIVE_ORDER;
            private static final Comparator NORMAL_COMPARATOR = ComparableComparator.getInstance();
            public BasicComparator() {
            public int compare(Object o1, Object o2) {
                if(o1 instanceof String && o2 instanceof String) {
                    return INSENSITIVE_COMPARATOR.compare(o1, o2);
                } else {
                    return NORMAL_COMPARATOR.compare(o1, o2);
    }

  • 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

  • Case insensitive comparison

    Is there a way or setting at instance level by which all character value comparisons can happen in case insensitive manner ( For example "ABC" = "Abc" or = "abc" ) without requiring to use upper or lower functions in every query

    No there isn't a way currently. You can create a function based index which improves the performance of case insensitive searches. For example:
    SQL> CREATE INDEX case_insensitive_ind ON my_table(NLS_UPPER(empname));
    SQL> SELECT * FROM my_table WHERE NLS_UPPER(empname) = 'KARL';

  • 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

  • Order by case insensitive?

    Hello,
    What's the best (optimized) way of sorting case insensitive? Will order by lowercase(field) use an index?
    Thanks.

    Hi,
    Using lower-case() is a good choice. Whether index takes effect is due to both container indexes and query expression. If you encounter any specified performance issue please post the question or send email ([email protected]) to me. Thanks.
    Best regards,
    Rucong Zhao
    Oracle Berkeley DB XML

  • 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

Maybe you are looking for

  • Problem in getting default value for Basic Pay

    Hi gurus, i have created a new structure in fresh new sap server for payroll. after completing configration. when i hire an employee system , it gives an error on info 8. It did not pick the value from t510 table. please response it is urgent. Nawaz

  • Question regarding ipad 3 replacement via warrentee.

    I have a question, basically my ipad 3 is glitching. It is a 64gb ipad 3, I am fairly positive apple will replace it for me. Considering I purchased the two year warranty. However I am wondering, Will they replace it with a newer ipad model? Or will

  • Ipod nano 1st gen stuck on hold

    i turn off hold but the hold button is still there can any one help theanks in advance

  • Task Details Page show 'Attachments' section empty

    hi, Using Project Server 2013, when i click on any task in My Task page, it takes me to Task Details where i cannot see any link to Attachments i.e. Issues, Risks and Documents. I have created & published a new project but problem still persists. Kin

  • Default template is English (US)

    Hi, when we create any new Office Document via the 'new document' button in SharePoint 2010 the default proofing language is always English (US).... No matter if the Regional settings in the Site Collections are English (UK), or the default in Office