Case insensitive in-memory search

I'm trying to create a case-insensitive in-memory search on a ViewObject. I'm using the following code for performing an in-memory search (~ filtering already retrieved rows from the ViewObject which is based on a webservice)
ViewObject vo = service.getMyViewObject();
vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
ViewCriteria vc = vo.createViewCriteria();
vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_CACHE);
ViewCriteriaRow vcr = vc.createViewCriteriaRow();
vcr.setAttribute("MyAttribute", "like 'abc%' ");
vc.add(vcr);
vo.applyViewCriteria(vc);
vo.executeQuery();This all works well .. but when I add vcr.setUpperColumns(true); and change line vcr.setAttribute("MyAttribute", "like 'abc%' "); into vcr.setAttribute("MyAttribute", "like 'ABC%' ");I get the following exception :
Caused by: oracle.jbo.expr.JIException: Method call has no object context
     at oracle.jbo.expr.JIParserMethodNode.evaluate(JIParserMethodNode.java:71)
     at oracle.jbo.expr.JIParserNode.evaluate(JIParserNode.java:740)
     at oracle.jbo.RowMatch.rowQualifies(RowMatch.java:230)
     at oracle.jbo.server.ViewObjectImpl.rowQualifies(ViewObjectImpl.java:1387)
     at oracle.jbo.server.QueryCollection.rowQualifies(QueryCollection.java:2308)
     at oracle.jbo.server.QueryCollection.removeUnqualifiedRows(QueryCollection.java:549)
     at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:719)
     at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
     at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)So, my question is: is it possible to do a case-insensitive in-memory search or should I convince my customer to drop the feature-request ;-)

Maybe I should add some extra info:
The viewobject is based on a webservice and not a database. I do not have access to the implementation of that webservice ( I only consume its data and store the results in the viewobject's datacollection ). The VO has no query attached and only has transient attributes. Therefore, I cannot use vo.setWhereClause() ~ I think.
Once I filled the viewobject's datacollection ( by overriding executeQueryForCollection() and createRowFromResultSet(...) ), I would like to filter the datacollection with filterparameters (from my jsf page). This can be enabled by first calling vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS) an
The in-memory search facility in the ViewObject's implementation seems to be restricted in filtering the viewobject's datacollection.
I've tried using ViewCriteria and RowMatch to filter the data ... with no success.
I hope I have explained my situation a bit more. Perhaps someone can help me out ?

Similar Messages

  • Case-Insensitive File Name Search on Unix

    Hello,
    I have a program which runs on a Unix OS and it looks for some files like file.csv, and then reads these files. Basically I know the file name and I look for that file name in a particular directory.
    Now, I want to make my program case-insensitive so that if the file name is file.csv or File.csv or FILE.csv, it should still locate that file and read it.
    Any advice....
    Thanks.

    Thanks.
    Probably I have to get all the file names in that
    directory and then try to match against the file name
    (using ignore case or toUpperCase() maybe), which I
    am looking for.
    Is there a way, where I don't have to get all the
    file names in that directory and can just go and get
    the FileReader Object etc for the file which I am
    looking for.No
    /Kaj

  • Case insensitive query or search in Form

    Hi,
    I have created a form based on a table. If i fill any of the field and then clicks the Query button for saerch it give me the record but it is case sensitive. How can i get this functionality ir-respectative of upeer-case or lower-case.
    Thanks in advance.
    Ejaz

    In the onQuery procedure you find this code:
    if "_convert" and "_operator" is not null then
    "_value" := replace("_value",'''','''''');
    "_where" := "_where" ||'ENAME' || "_operator" || ''''|| "_value" ||''' and ';
    elsif "_convert" and "_operator" is null then
    "_value" := replace("_value",'''','''''');
    "_where" := "_where" ||'ENAME like '''|| "_value" ||''' and ';
    elsif not "_convert" then
    "_where" := "_where" ||'ENAME '|| "_value" ||' and ';
    end if;
    You should modify this to get what you want. However be warned that changing the generated package is not supported and any changes will be lost on regenerating the component.
    Regards,
    Hsiu

  • Case-insensitive Search with Search Form

    I am using a Search Form with a UIX Page. One of the issue that need to be resolved is to be able to do case-insensitive search for text information stored in some database columns. Please advise me how to implement case_insensitive search with JDeveloper's Search Form.
    Thanks in advance,

    Hi Qian,
    This article (below) by Steve Muench explains how you can customize Query by example behaviour of ADF BCs and if you really want, how to create your own ViewCriteriaAdapter (but you don't have to go quite that far - luckily :) ).
    http://radio.weblogs.com/0118231/2005/02/10.html#a492
    Here is what I did. I implemented the following method in my base view object class (MyBaseViewObject). Note that this code is based on a piece of code that Steve posted on his blog (http://radio.weblogs.com/0118231/stories/2003/07/11/implementingAViewCriteriaAdapterToCustomizeQueryByExampleFunctionality.html); originally an example about creating your own ViewCriteriaAdapter.
    Since applyViewCriteria(oracle.jbo.ViewCriteria) is used by the query-by-example mechanism you're able to "intercept" the ViewCriteria on "it's way in". After that the standard ViewCriteria does it's job as ususal and generated the where clause when required.
    public void applyViewCriteria(ViewCriteria vc)
         if( null == vc || vc.size() == 0 ) super.applyViewCriteria(vc);
         ViewCriteriaRow criteriaRow = (ViewCriteriaRow)vc.first();
         StructureDef def = criteriaRow.getStructureDef();
         AttributeDef[] attrs = def.getAttributeDefs();
         System.out.println(getClass().getName() + ": applyViewCriteria()");
         boolean bFirst = true;
         do{
           if(vc.hasNext() && !bFirst) criteriaRow = (ViewCriteriaRow)vc.next();
           criteriaRow.setUpperColumns(true);
           for (int j = 0, attrCt = attrs.length; j < attrCt; j++)
             String criteriaAttrVal = ((String)criteriaRow.getAttribute(j));
             if (criteriaAttrVal != null && !criteriaAttrVal.equals("") && !JboTypeMap.isNumericType(attrs[j].getSQLType()))
              criteriaRow.setAttribute(j,criteriaAttrVal.toUpperCase());
           bFirst=false;
         }while(vc.hasNext());
         super.applyViewCriteria(vc);
    NOTE that doing this makes all your views case insensitive (to vc search) you may want to implement more functionality in your base view object to set whether a view is in case insensitive mode or not.
    ALSO that flag will not be passivated (if I remember correctly - someone correct me if I'm wrong) so you'll have to add that flag to the passivated data.
    Cheers!
    Sacha

  • Case insensitive searching for criteria "All metadata"

    If I'm specifically searching in (for example) keywords, then the search is case insensitive. However, if I'm searching "All metadata" then the search is case sensitive. I don't know if this is a bug or a feature (seems like a bug to me), but I'd really prefer it to remain case insensitive for this search criterion as well.
    While I'm at it, I'd like to be able to search the IPTC headline.
    Bart

    I'll second that request on both counts! In fact, I'd like to see the ability to search based on any XMP field.
    -Andrew

  • XMLIndex - case insensitive search ?

    When creating an XMLIndex, is there an option to create it as case-insensitive, so any searches based on that will ignore case ?
    My business requirement is that a search, e.g. for 'bank', should match bank, Bank, BANK, etc. ignoring case.
    I could put a TO_UPPER around all my comparisons, but my concern then is that the XMLindex will get ignored and I end with with full table scans all the time.

    If I am not mistaken, you can create an function based index as an extra layer on top of the XMLIndex / Path Table...

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

  • 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

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

  • Search for LIFNR case insensitive + range

    Ladies and gentlemen,
    I could use your help. I need to select rows from LFA1 where the name (NAME1) matches a string. It has two difficult points, which I were not able to combine into a single solution, even after all the research I done.
    - I need the search to be case insensitive (I found a partial solution here)
    - I need to combine it with a range table
    So: I need a case insensitive search using range table. Can this be done effectively? Or is there any workaround you could suggest? This is just a minor part of the report about invoices and must not take long.
    Thank you for the time and effort,
    Cheers Otto

    Thank you, guys,
    you are very helpful, your ideas solved my problem. The MCOD* idea is easy/fast and solve my problem very well. I don´t understand why I didn´t find it myself. Hope to pay you back one day:))
    For others interested:
          DATA sx_dodnam TYPE TABLE OF z_dodnam_range.
          DATA wa_dodnam LIKE LINE OF sx_dodnam.
          LOOP AT s_dodnam INTO wa_dodnam.
            TRANSLATE wa_dodnam-low  TO UPPER CASE.
            TRANSLATE wa_dodnam-high TO UPPER CASE.
            APPEND wa_dodnam TO sx_dodnam.
          ENDLOOP.
          SELECT lifnr INTO wa_lifnr-low FROM lfa1 WHERE stcd2 IN s_ico AND mcod1 IN sx_dodnam.
            IF sy-subrc = 0.
              wa_lifnr-sign = 'I'.
              wa_lifnr-option = 'EQ'.
              APPEND wa_lifnr TO lt_lifnr.
            ENDIF.
          ENDSELECT.
    Cheers Otto

  • Case insensitive quick search of UCM

    'Quick Search' in UCM looks case sensitive. If I create a file with title as 'Test File' it shows result in following cases
    Test
    Test File
    But it can't show result when I search for
    test
    test file
    Is there a way to make it case insensitive search?
    Thanks
    Sanjeev

    Hi,
    Already answered in the following thread :https://forums.oracle.com/thread/2193824
    Romain.

  • Case sensitive and case insensitive Search

    Hi friends,
         Iam doing an Search RFC which will search records based on the search parameters provided at the portal side.
    One of the search parameter is a field with 40 character which holds the description(title) of the record.
    With this search paramter iam facing case sensitive problem.
    Example:
    Values in Database Table: ( Can be in any case)
           Record 1:  Sensitive
           Record 2:  SENSITIVE
           Record 3:  SensTive
           Record 4:  sensitive
           Record 5:  sensTive
         Input to RFC:  sens*
         Output: Getting only 4rth and 5th record but not all the records.
           The same is the case with the remaining search parameters(Like user name..).
           Is there any way of getting all the records when searching from the data base (with case insensitive).
           Kindly let me know if there is any possibility.
    Thanks in advance.
    Regards,
    Swarna Munukoti.

    Generally, no.  So, you'll either have to use EXEC SQL, or add more fields to the table.  You can do this using APPEND structures, which is the SAP approved way of adding fields.  If there are suitable user exits in the standard SAP code, then you'll be able to populate the additional fields there, as new records are created, or amended.
    Alternatively, create your own Z table with the same key as the standard table and a "search field" which contains the uppercase version of the field you're wanting to search.  You can either, again populate in suitable user exits, or, in worst case, have job that runs regularly populating your Z table.
    matt

  • Search case-insensitive.

    HI All ,
    i want to create program that use search from table but case-insensitive ,
    How i can do that ?
    Regards
    James
        SELECT agr_name UP TO iv_limit ROWS
        FROM ZROLE
        INTO TABLE lt_re_role
        WHERE agr_name LIKE lv_search_value.

    Hi,
    If the definition is not case sensitive, then always the data is stored in CAPS by default.
    So what u can do it, translate your string to UPPER CASE and then select.
    Place below statement just before your select.
    TRANSLATE lv_search_value TO UPPER CASE.
    SELECT agr_name UP TO iv_limit ROWS
    FROM ZROLE
    INTO TABLE lt_re_role
    WHERE agr_name LIKE lv_search_value.
    Thanks,
    Vinod.

  • 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 search in select statement

    Hi Experts,
      I have entries in table as mixed case. For example i am searching on an attribute called description in the table. I want the serch to be case insensitive for that attribute. Because in table it is i.e. JUMBO Pack and in the search attribute it is i.e. Jumbo Pack.
    I do not want to translate both to the same case and search. Is there an option?
    Best Regards!
    Sandip

    Hi Sandip,
    One more alternative:
    If ztext is ur original field which is saving the mixed text.
    Append one extra field(ztext_upper) to the table.
    Now if " Sap Sdn" is the text we are saving then
    While saving the entires to the table,
    1. asusual save the value(" Sap Sdn") to teh original field(ztext)
    2. translate the value to upper case(SAP SDN) and save this entry to teh newly appended field(ztext_upper)
    Now while doing search, translate to upper case and compare with the value in ztext_upper. If it satisfies then for display options select the original value from the field (ztext) which is corresponding to the satisfied ztext_upper field.
    Regards,
    Swarna Munukoti.

Maybe you are looking for