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

Similar Messages

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

  • Case insensitive query on a CLOB item

    Hi all
    i have this problem...
    i have a table which contains a CLOB column
    in my form i have a block based on this table.
    i noticed that when i query the form on the clob item , it doesn't accept the case insensitive query property.
    (so if i query %AA% the form doesn't show 'Aa' or the 'aa')
    can you please help me?
    thanks!

    Forms is not really instrumented to query clobs directly. Google "oracle forms and clob" to see some suggestions on how to handle clobs in Forms

  • Case insensitive query from a JSP

    I am using JDeveloper 3.1 to create JSP applications using the wizard for business components for JSP application.
    The default query screen allows a search to be performed on all the fields on the table (using the Findform web bean).
    How can I change the search such that the query is Case Insensitive ?
    Many Thanks,
    Ketan.
    Many Thanks,
    Ketan.

    Forms is not really instrumented to query clobs directly. Google "oracle forms and clob" to see some suggestions on how to handle clobs in Forms

  • SELECT INTO doing case insensitive query?

    Hi all,
    I'm having a problem with a query acting as if it is case-insensitive when I do a "SELECT table.x INTO variable ...". If I do the same query, without the "INTO variable", I get one result, as expected.
    The query is similar to the following:
    SELECT table_id INTO variable FROM table WHERE table.varchar2column = 'name' AND table.integercolumn = int_variable;
    There is a unique constraint forcing the varchar2column / integercolumn values to be unique.
    If the varchar2column has two entries that differ only in case, a regular select statement returns one result. However, in the stored procedure using the INTO, I get the following error message:
    ORA-01422: exact fetch returns more than requested number of rows
    It does not get that if I remove the entry that differs only in letter-case. This is Oracle 10.2.0.1.0, if that matters.
    I need this query to be case sensitive. I'm not a DB expert, I'm just a developer trying to fix a problem. I attempted to run "ALTER session SET nls_sort = binary" in the stored procedure, but I guess I can't do that...
    Any suggestions would be appreciated.

    791307 wrote:
    SELECT table_id INTO variable FROM table WHERE table.varchar2column = 'name' AND table.integercolumn = int_variable;
    ...When you say, "...AND table.integercolumn = int_variable;" What is the name of int_variable? Does that name match some column name? Could you post the table creats and a complete sample PL/SQL block with your issue?
    One of the things that gets me every once in awhile is having a variable name that matches a column name. In that case the column name is used inside the select statement, not the variable. To avoid that issue, I use v_ for all my variables. (Others have different standard prefixes.)
    I only point this out, because it might be given results that look case insensitive on the varchar2 column, but is really an issue with the integer column matching to a variable:
    SQL> drop table T;
    Table dropped.
    SQL> create table T (id number constraint T_PK primary key
      2      , Varchar2Data varchar2(20)
      3      , NumberData number(38)
      4      , constraint T_UK1 unique (Varchar2Data, NumberData)
      5  );
    Table created.
    SQL> insert into T values (1, 'STRING', 100);
    1 row created.
    SQL> insert into T values (2, 'string', 200);
    1 row created.
    SQL> insert into T values (3, 'STRING', 300);
    1 row created.
    SQL> select * from T where Varchar2Data = 'STRING' and NumberData = 100;
            ID VARCHAR2DATA         NUMBERDATA
             1 STRING                      100
    SQL> declare
      2      NumberData number(38);
      3      Id Number;
      4  begin
      5      NumberData := 100;
      6      select Id into Id
      7      from T
      8      where T.Varchar2Data = 'STRING'
      9      and T.NumberData = NumberData;
    10      DBMS_OUTPUT.PUT_LINE(Id);
    11  end;
    12  /
    declare
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 6
    SQL> declare
      2      v_NumberData number(38);
      3      v_Id Number;
      4  begin
      5      v_NumberData := 100;
      6      select Id into v_Id
      7      from T
      8      where T.Varchar2Data = 'STRING'
      9      and T.NumberData = v_NumberData;
    10      DBMS_OUTPUT.PUT_LINE(v_Id);
    11  end;
    12  /
    1
    PL/SQL procedure successfully completed.
    SQL>

  • 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

    I'm trying to do a query ignoring case.
    select to_upper(node) from STATUS where to_upper(node) = 'KAN';
    I get ORA-00904 : invalid colum name
    I also tried to use a column alias but got the same result
    select to_upper(node) nnn from STATUS where nnn = 'KAN'
    I'm stuck
    George

    Hi,
    try upper(node) instead of to_upper.
    hth

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

  • Case Insensitive Querys

    If I have a table that has a column called login_name defined as char(64).
    I currenrly prepare statments that look like:
    select something from some_table where login_name like ?;
    Can I use the following if I wanted to implement a case insensitive query, and are there performance implications?
    select something from some_table where UPPER(login_name) like ?;

    The best way from a performance perspective is to also store the upper (or lower) case form of 'login_name' in an additional column of the table (ucase_login_name), have the application itself convert the parameter value to upper or lower case and the njust do:
    select something from some_table where ucase_login_name like ?;
    As long as any wildcards are at the end of the passed in parameter this will use an index if one is defined on that column.
    Chris

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

  • How to hide "Note that the search is case insensitive" text from Query Region

    Hi,
    When create a search page with Query region : Autocustomizationcriteria mode, page is showing automatically "Note that the search is case insensitive" text is showing automatically.
    this is not needed. can you please let me know how to hide this one from page.
    Regards,
    Ram

    Check this link:
    https://forums.oracle.com/message/9227812#9227812
    --Sushant

  • Use of wildcard and case insensitive searches

    Used the "Create form from a table" option. Have a customized form for this table to query, insert, update, and delete rows. My question is how can I allow a user to 1) search using a wildcard (%) from this form and 2) how can I make the search case insensitive for my users.
    Thanks

    Hi,
    Why not create a report to find the records and link to the form from the report.
    You can then set the where clause to be whatever you wish:
    where tablename.columnname like :parameter
    or even:
    where UPPER(tablename.columnname) like UPPER(:parameter)
    Regards Michael

  • Making ADF Search case insensitive without using Execute with Params??

    I have a ADF search page baed on VO. I'm not Execute with Params form, instead i'm using normal ADF search page. Is it possible to make the search case insensitive?? if yes, how to do that?

    Ok, i'll try to find out the SRDemo application using ADF BC.
    And In Execute with params form,i'm already using UPPER on both the sides of where clause.
    Say my VO query is like
    select <table name>,...
    from fnd_tables t,fnd_applications a
    where a.application_id = t.application_id
    and upper(t.table_name) like upper(:EntityName) || '%'
    Then i created the ADF paramaters form by dragging and dropping the Execute with param from data control pallette.. when i run this page and do the search, it throws the error given in my second update...Any clue why that error is coming?
    Thanks
    Senthil

Maybe you are looking for