Query by Example requires PK?

I have a table with an id for the primary key. It has two fields with ids from other tables, and each has a foreign key to that other table. There is a unique constraint on the combination of these two foreign key fields. In Java, I have a class with two attributes that are mapped as one-to-one relationships to the other two classes. When I run the following code, TopLink generates the illustrated SQL:
public static BookPageJoin select(Session ersSession, Book aBook, Page aPage) {
     BookPageJoin example = new BookPageJoin();
     example.setBook( aBook );
     example.setPage( aPage );
     ReadObjectQuery query = new ReadObjectQuery(example);
     return (BookPageJoin)ersSession.executeQuery( query );
DatabaseSession(289)--Connection(295)--SELECT LOCKVERSION, OBJECTID, ORDER_INDEX, BOOK_ID, PAGE_ID FROM BOOK_PAGE_JOIN WHERE (OBJECTID = NULL)So, even though my example query is based on the two related objects, TopLink is building a query based on the primary key, which of course I haven't set on the example object. I tried both the above and just passing the example object to session.readObject, with the same results.
If I go into the mapping workbench (in JDev 9.0.5.2) and tell TopLink that the two fk fields are the pk, then the Query by Example works.
It seems like a notable limitation if the QBE requires that you set the pk attribute(s) on the example, and in the doc it just said I could use any attribute that was direct-to-field or one-to-one.
What am I missing here?
(BTW: I know I could map the many-to-many between Book and Page without having a domain object for the join table, but in this case the join also has an order attribute on it.)

The Query API that is being used will not perform a QueryByExample(QBE) query. It will simply perform a primary key query based on the PK of the provide object. To perform a simple QBE query use the following API:
new ReadObjectQuery(example, new QueryByExamplePolicy());
Please see the JavaDocs for oracle.toplink.queryframework.QueryByExamplePolicy for specific configuration options.
--Gordon

Similar Messages

  • PanelCollection -   Query By example Label Change

    Hi,
    We have panel collection in our screen with the properties of defaultToolbarItemDisplay="iconAndText",
    but its showing the Query By Example icon only, not showing the label.
    Our requirement is We have to show the label as Search after the QBE icon.
    We are using Jdeveloper 11.1.1.4.0
    Please give me the suggestion..
    Best Regards,
    Vijay

    Hi,
    did not have a chance to reproduce, but I would suggest testing with 11.1.1.5 and if it is the same problem there, file a bug with customer support
    Frank

  • Query by example - how can I display VCRow in JTable?

    I would like to provide the user with a searchable table.
    Actually I would like to use two tables: one, displaying one row where the user can specify the search criteria. And the second table should display the data found.
    I could store the entered criteria locally in a hashmap in TableModel, for example, then create a WHERE clause. This solution is quite messy, since the user can add, remove and rearrange the columns of both tables.
    Or I could use -I hope- the query-by-example feature, like this:
    am = app.getApplicationModule();
    ViewObject vo = am.createViewObject( "MyVO", "mypackage1.PatView" );
    ViewCriteria vc = vo.createViewCriteria();
    ViewCriteriaRow vcr = vc.createViewCriteriaRow();
    Now I can set attributes and use vo.applyViewCriteria() to find my data.
    But how can I bring the first JTable to display this single ViewCriteriaRow, so that the user can do the editing?
    The JUNavigationBar does it, if I am not mistaken. It switches the PanelBinding to find mode, and then a JTable displays a ViewCriteriaRow (?) instead of the ViewObject's data. But I don't want to use the bar. How do I create this behaviour manually?
    The javadoc of JUPanelBinding says:
    "Sets this panel and all its associated iterators into find mode."
    So I guess that setting iterators into find mode is what I need. But I cannot figure out how to do that. Who can?

    You cannot set the iterators in a panelBinding to separate find/data modes individually.
    However you can create two JUPanelBinding objects one for the findMode form and one that displays Data.
    here's what I did to modify a generated SingleForm, to display two panels of the same type one in find mode and other in data mode.
    I changed the jbInit method of the "LayoutPanel" class to be like:
    //declare this as a member of the class.
    JButton findBtn;
    public void jbInit() throws Exception
    // Panel layout
    masterViewPanel = new PanelDeptView(panelBinding);
    //create another instance of PanelBinding for a second (findform) DeptView panel.
    JUPanelBinding binding = new JUPanelBinding("Project3.Mypackage1Module", this);
    binding.setApplication(panelBinding.getApplication());
    masterViewPanel1 = new PanelDeptView(binding); //create second instance
    findBtn = masterViewPanel1.navBar.getButton(JUNavigationBar.BUTTON_FIND);
    findBtn.doClick(); //set the second instance in find mode.
    //add a listener on the second instance's execute button so that it resets the form into find mode
    //this forces the second instance to be in find mode when execute button is pressed.
    masterViewPanel1.navBar.getButton(JUNavigationBar.BUTTON_EXECUTE).addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ev)
    SwingUtilities.invokeLater(new Runnable() {
    public void run()
    findBtn.doClick();
    this.setLayout(panelLayout);
    add(masterViewPanel, BorderLayout.WEST);
    //add the second instance.
    add(masterViewPanel1, BorderLayout.EAST);
    I also had to call findBtn.doClick() again in the "constructor" that takes (JUApplication, boolean) after the panelBinding is executed,
    to force the initial startup of this panel in findmode

  • How to build "Query by example" Report?

    I want to create a report which allows user to select which columns to return.
    It is similar to "Query by example" form. Have someone done that before and share me the PL/SQL how to do that?
    Thanks in advance.

    I got the answer, u need to set table.setFilterModel("") and refresh panel collection which contains this table
    whenever u need to make "Query By Example" button of panel collection invisible.

  • Please provide the sql query on mentioned requirement in attached image.

    Please provide query for this requirement
    1.This is my main table  data.
    FACTID DATE_DMN_KEY
    WQTY ROWID
    AVG_7_AMT
    1 100   
    1000 1
    NULL
    1 200 2000
    2 NULL
    1 300 3000
    3 NULL
    1 400 4000
    4 NULL
    1 500 5000
    5 NULL
    1 600 6000
    6 NULL
    1 700 7000
    7 NULL
    1 800 8000
    8 NULL
    1 900 9000
    9 NULL
    1 1000
    10000 10
    NULL
    2.  column rowid =10 is the latest record and COLUMN AVG_7_AMT value should be update as below
        Sum (WQTY=10000+9000+8000+7000+6000+5000+4000)/7
    3.FOR  column rowid =9 record and COLUMN AVG_7_AMT value should be update as below
       Sum (WQTY=9000+8000+7000+6000+5000+4000+3000)/7
    4. FOR  column rowid =8 record and COLUMN AVG_7_AMT value should be update as below
       Sum (WQTY=8000+7000+6000+5000+4000+3000+2000)/7
    5. . FOR  column rowid =7 record and COLUMN AVG_7_AMT value should be update as below
       Sum (WQTY=7000+6000+5000+4000+3000+2000+1000)/7
    6.  FOR  column rowid =6 record and COLUMN AVG_7_AMT value should be update as below
       Sum (WQTY=6000+5000+4000+3000+2000+1000)/6
    7. FOR  column rowid =5 record and COLUMN AVG_7_AMT value should be update as below
       Sum (WQTY=5000+4000+3000+2000+1000)/5
    How we can write sql  query for this type of requirement.

    Query is working but partially..
    if you insert  below records in same fact table then it wont work because factId=1 and factid 2 are different transaction .. how 
    Insert into fact Values
    (2, 100, 1000,   NULL),
    (2, 200, 2000,  NULL),
    (2, 300, 3000,  NULL),
    (2 ,400, 4000,  NULL),
    (2, 500 ,5000,  NULL),
    (2, 600, 6000,  NULL),
    (2, 700, 7000 , NULL),
    (2, 800, 8000,  NULL),
    (2, 900, 9000,  NULL),
    (2, 1000,  10000,   NULL )
    then result should like below.
    FACTID
    DATE_DMN_KEY
    WQTY
    ROWID
    AVG_7_AMT
    1
    100
    1000
    1
    1000
    1
    200
    2000
    2
    3000
    1
    300
    3000
    3
    6000
    1
    400
    4000
    4
    10000
    1
    500
    5000
    5
    15000
    1
    600
    6000
    6
    21000
    1
    700
    7000
    7
    28000
    1
    800
    8000
    8
    35000
    1
    900
    9000
    9
    42000
    1
    1000
    10000
    10
    49000
    2
    100
    1000
    1
    1000
    2
    200
    2000
    2
    3000
    2
    300
    3000
    3
    6000
    2
    400
    4000
    4
    10000
    2
    500
    5000
    5
    15000
    2
    600
    6000
    6
    21000
    2
    700
    7000
    7
    28000
    2
    800
    8000
    8
    35000
    2
    900
    9000
    9
    42000
    2
    1000
    10000
    10
    49000

  • Clearing VO dynamic Query-By-Example ViewCriteria

    Looking for some help with JDev 11.1.1.4.0, ADF BC + ADF Faces RC please.
    At it's simplest we're looking how to clear the query-by-example (QBE) filters on a VO without using the table UI component and not accidentally clearing other view criteria on the VO. To explain our use case first let me define the characteristics of our app. We have:
    a) A BTF based on fragments:
    a.1) The transaction/data control scope = Use Existing Transaction if Possible/Shared
    a.2) It contains a single fragment
    a.3) The fragment contains a table based on an ADF BC View Object (VO)
    a.4) The VO has a view criteria defined at design time, implemented via the Application Module (AM)
    a.5) The table allows the user to filter the data
    a.6) The BTF does not include any task flow returns or parent actions
    b) A consuming BTF based on pages:
    b.1) The transaction/data control scope = Always Begin New Transaction/Isolated
    b.2) It contains 2 pages with navigation rules to move between them (back/forward)
    b.3) The fragment from "a" is included on both pages in "b"
    b.4) When navigation occurs between the pages, it is invoked via buttons in this BTF, not the original BTF via parent actions or task flow returns. This aligns with point a.6. As such when navigations occurs between the 2 pages, the region/task flow binding instance of "a" in the region of the current page of "b" is prematurely terminated. The implication is the instance of "a" doesn't get a chance to do any processing before it is closed.
    Note that "a" and "b" are built in isolation of each other. "b" has no inherit knowledge about the components of "a" nor the ADF BC components. The implication is "b" cannot attempt to grab the table UI component, nor manipulate the ADF BC components as it doesn't know anything about the BTFs dropped on its pages.
    If the user opens the 1st page in "b" and enters a query-by-example criteria on the table from the region containing the 1st of instance of "a", then the user navigates to the 2nd page, the filter criteria are still set on the 2nd instance of "a". This is expected behaviour as "a" has data control scope = shared implying when the QBE criteria are set on page 1, they are written down to the VO, which when the user navigates to page 2, as it is sharing the same VO the QBE criteria are there to reuse/share on page 2.
    In our scenario what we want to do:
    1) Is in navigating between the 2 pages, we wish the query-by-example filter criteria to be cleared/reset, such that navigating between pages the filter criteria are empty/fresh
    2) However in navigating between the pages we must not lose the design time view criteria (and it's bind variable value) that has already been applied
    3) Maintain shared data control scope so we minimize the amount of database connections
    The common solution to clearing the QBE filter is as per Timo Hahn's following blog entry: http://tompeez.wordpress.com/2011/10/29/jdev-how-to-reset-a-filter-on-an-aftable/
    Yet that solution assumes the code has access to the table UI component. As we need the QBE criteria reset on navigation caused by "b", and such navigation causes a premature termination of "a" there's no chance for "a" to grab the table component and clear the filter criteria before "b" navigates away. The logical solution to this is on entering "a" again, to programatically reset the QBE criteria as part of the initial steps in the "a" BTF. But on entering "a" using Timo's solution, the method call doesn't have access to table UI component as the fragment isn't yet rendered, making this solution not viable.
    Another solution we've tried is calling applyViewCriteria(null) then reapplying our view criteria from a VO client interface method, but it appears we aren't clearing the QBE criteria. This worries me a bit because it looks like you can't discern the QBE view criteria from the normal view criteria unless you go through the table UI component methods.
    So how do we clear the QBE filter criteria programatically, without clearing (or at least restoring) the design time view criteria, and without relying on the table UI component to clear the QBE criteria?
    Phew, I hope that makes sense? Thanks for your help in advance.
    CM.
    PS. There is an assumption in the title of my post that table Query By Example criteria are stored as ADF BC View Object view criteria. Possibly it's a separate mechanism so please be careful this doesn't lead you astray in answering my post.

    Chris,
    I don't have time to follow this through right now, but I'm on to something.
    I was able to affect the filter via the binding container (at least it's not the UI). See this code:
      public void a(ActionEvent e)
       String s = "#{bindings.EmployeesView1Query.queryDescriptor}";
       Object o = JSFUtils.resolveExpression(s);
       FilterableQueryDescriptor f = (FilterableQueryDescriptor) o;
       f.removeCriterion(f.getCurrentCriterion());
      }Now, it doesn't do exactly what you want (it actually somehow makes no rows show up in the table), but I believe it's moving in the right direction.
    Am leaving for the office (5:40 am), so I'll pass this over to you to have a gander.
    John

  • JClient query by example doesn't work in 10.1.2.

    I've a JClient application I migrated from 9.0.4 to 10.1.2.
    In the migrated app query by example doesn't work anymore in JTables.
    Could someone help ?
    Tks
    Tullio

    Frank, I got a testcase from Tullio. It's a 9.0.4 project uding JClient that is pre-ADF bindings.
    I migrated his 9.0.4 project to 9.0.5.2 first.
    In 9.0.5.2, I see already a change in behavior related to enter-query mode in the JTable, but the number of rows displayed looks correct.
    Tullio, can you confirm if the problem you are seeing vis a vis enter query mode is that if you:
    1. Click enter-query button
    2. Click into a field like Ename and type SMITH but don't [Tab] out of that field yet
    3. Click on the execute-query button
    It behaves as if you've entered no criteria there.
    If at step 2 above you clicked [Tab] to exit the field where you typed SMITH, then it works correctly.
    Is this the enter-query-JTable-related problem you're seeing (that is, related to when you don't focus-out of the field?)
    The "number-of-rows-displayed" issue you mention in this other thread (10.1.2 JClient binding Error. does reproduce with your testcase only in 10.1.2 (as well as also still having this 9.0.5.2 focus-related issue in enter query mode).

  • Query by Example

    Hi All,
    Query by example will provide the search criteria.
    Like it is a buttion in navigation bar.If I click on that all the data in the screen will be cleared if I have a JTable binded to a viewObject.
    IF I enter 'not null' for an attribute and click on execute..
    It will display all the records which matches the criteria.
    My Question is Can I get the 'not null'...which I used for one of the attribute filter.
    Like I want to retrive the runtime attribute value?
    Please help me.
    Any help will be appreciated.
    Thanks
    Sowmya

    you'll find Query By Example screens inside our SQLWorkshop, and those do look much like the Portal ones. if you'd like to build your own QBE forms into your web app, i'd suggest the following:
    -use our Report wizard to generate a report based on a sql query that selects all the columns of your table.
    -add text field Items to the page for each column for which you'd like to do provide QBE ability.
    -add Where clauses to the sql in your report region that refer to the items you added in the previous step
    -add a button that branches back to the same page
    that should pretty much do it. you'd probably want to smooth things with a reset button to clear the cache for the items, but that depends on how you want your QBE page to function.
    hope this helps,
    raj

  • Expert Mode ViewObject: default 'query by example' mechanism does not work

    In JDeveloper 11G 1.1.1
    I have created an Expert Mode view object(VO) which I'm trying to filter in an ADF Swing Panel
    The Panel contains a Swing Table created by dropping a VO data control on the panel as an ADF bound Swing Table.
    TEST
    Run the panel.
    Set the Query Mode on (from the Database menu)
    Enter a relevant view criterion
    Execute the Query
    TEST FAILS
    Table is refreshed but it still displays the entire VO collection (non-filtered).
    Repeating the same experiment with a default, entity object generated VO works as expected.
    Question
    Can the default 'query-by-example' mechanism as provided by the JUTestFrame and the JUNavigationBar be used with Expert Mode view Objects?
    If yes are there any tricks to making this work?

    Hello Frank;
    Additional TEST RESULTS
    In JDev11G
    The default 'query by example mechanism' does not work if you create a new View Object using the <Select data source...> option <Read-only access through SQL query>.
    However, IT DOES WORK if you create a new ViewObject selecting <Updatable access through entity objects> and in the Query step you select <Expert Mode>
    Could you please check and confirm.
    Thanks!
    Ioannis
    Edited by: imouts on Dec 5, 2008 1:38 PM

  • BC4J Query by example for dates uses wrong date format

    When querying by example on date fields, I get the following nested exceptions:
    oracle.jbo.SQLStmtException: JBO-27121: SQL error during statement execution.
    JBO-26044: Error while getting estimated row count for view object
    and
    java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string.
    It would seem to be caused by the following clause added to the end of the entity object's query:
    "QRSLT WHERE ( ( (DATE_FIELD = TO_DATE('23/12/2003', 'yyyy-mm-dd')) ) )"
    which causes problems as our entity objects use a 'dd/MM/yyyy' date format.
    Is there a way we can make the query by example use the same date format as the rest of our app?

    I‘m not an expert on this but I see nobody is replying so this might help you. I've been having problems with dates as well and I‘m pretty sure that the attached formatter isn't used in find mode. That is because the java date class (can't remember which one) used by the BC4J has the format yyyy-mm-dd. I don't now if it is possible to change it but I got around the problem by writing my own domain. You can take a look at Toystore demo, by Steve Muench, that uses a custom date domain, ExpirationDate (see the code below). It is mapped to a VARCHAR column in the database but it is possible to map it to a DATE column.
    I have been watching the postings with questions about dates and I have noticed that a lot of people have problems with this but I haven’t seen an answer yet.
    package toystore.model.datatypes.common;
    import java.io.Serializable;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import oracle.jbo.Transaction;
    import oracle.jbo.domain.DataCreationException;
    import oracle.jbo.domain.DomainInterface;
    import oracle.jbo.domain.DomainOwnerInterface;
    // --- File generated by Oracle Business Components for Java.
    * This custom datatype implements an immutable domain class that
    * maps to a VARCHAR column containing values like '10/2004' representing
    * expiration dates of credit cards. We could have chosen to implement
    * this as a domain that stores itself in a DATE column instead of a
    * VARCHAR column, but since the Java Pet Store demo schema stored the
    * information in a VARCHAR column, we decided to illustrate how to
    * accommodate that case using domains.
    public class ExpirationDate implements DomainInterface, Serializable {
    private Date mDate;
    private String mDateAsString;
    protected ExpirationDate() {
    mDate = new Date();
    convertDateToStringFormat();
    * Return the value of the expiration date as a java.util.Date
    public Date getDateValue() {
    return mDate;
    * Allow expiration date to be constructed from two
    * strings representing month and year
    public ExpirationDate(String monthVal, String yearVal) {
    this(monthVal+'/'+yearVal);
    public ExpirationDate(String val) {
    validate(val);
    convertDateToStringFormat();
    * The getData() method must return the type of object that JDBC will
    * see for storage in the database. Since we want this ExpirationDate
    * datatype to map to a VARCHAR column in the database, we return the
    * string format of the date
    public Object getData() {
    return mDateAsString;
    * <b>Internal:</b> <em>Applications should not use this method.</em>
    public void setContext(DomainOwnerInterface owner, Transaction trans, Object obj) {
    * Performs basic validation on strings that represent expiration dates
    * in the format of MM/YYYY. Note that in the process of testing whether
    * the string represents a valid month and year, we end up setting
    * the private member variable mDate with the date value, so if the
    * validate() method does not throw an exception, the mDate will be setup.
    protected void validate(String val) {
    if (val != null) {
    if (val.length() != 7 ||
    val.charAt(2) != '/' ||
    !isAllDigitsExceptSlashAtPositionTwo(val) ||
    !isValidMonthAndYear(val)) {
    throw new DataCreationException(ErrorMessages.class,
    ErrorMessages.INVALID_EXPRDATE,
    null,null);
    * Returns true if all digits except position 2 (zero-based) are digits
    private boolean isAllDigitsExceptSlashAtPositionTwo(String val) {
    for (int z=0, max = val.length(); z < max; z++) {
    if (z != 2 && !Character.isDigit(val.charAt(z))) {
    return false;
    return true;
    * Returns true if the val string, assumed to be in "MM/YYYY" format
    * is a valid month and year value, setting the mDate member variable
    * if they are valid.
    private boolean isValidMonthAndYear(String val) {
    try {
    int month = Integer.parseInt(val.substring(0,2));
    int year = Integer.parseInt(val.substring(3));
    Calendar c = Calendar.getInstance();
    c.setLenient(false);
    c.set(year,month-1,1); // Month is zero-based !
    mDate = c.getTime();
    catch (IllegalArgumentException i) {
    return false;
    return true;
    public String toString() {
    return mDateAsString;
    * Convert mDate to String format
    private void convertDateToStringFormat() {
    if (mDate != null) {
    SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
    mDateAsString = sdf.format(mDate);
    * Return true if the expiration date is in the future
    public boolean isFutureDate() {
    return mDate.compareTo(new Date())> 0;
    * Compare the Expiration Dates by comparing their respective
    * getData() values
    public boolean equals(Object obj) {
    if (obj instanceof DomainInterface) {
    Object thisData = getData();
    if (thisData != null) {
    return thisData.equals(((DomainInterface)obj).getData());
    return ((DomainInterface)obj).getData() == null;
    return false;

  • OSLC Query to get requirements from a RequirementCollection on DOORS NG

    Hi,
    I'm using DOORS NG (V5.0.2) and I'm trying to get requirements referenced by a RequirementCollection using OSLC.
    I tried the query given on:
    https://jazz.net/library/article/1197
    which is:
    &oslc.prefix=rdf=<http://www.w3.org/1999/02/22-rdf-syntax-ns%23>,dcterms=<http://purl.org/dc/terms/>&oslc.select=*&oslc.where=rdf:type=<http://open-services.net/ns/rm%23Requirement>
    But this query only returns the RequirementCollection itself.
    So, is the query correct?

    Hello Jim,
    In fact, as you say, that query returns all requirements on a project. I was wrong with the query that I posted and the correct one is the query that you posted, i.e.:
    &oslc.prefix=oslc_rm=<http://open-services.net/ns/rm%23>,dcterms=<http://purl.org/dc/terms/>&oslc.select=oslc_rm:uses&oslc.where=dcterms:identifier=1
    However, this query only returns the RequirementCollection whose identifier is 1 and it does not return its requirements.
    The solution that I found and it was supported by Jazz forum (https://jazz.net/forum/questions/200343/oslc-query-for-getting-requirements-from-a-requirement-collection) is to get the RequirementCollection and using the "uses" attributes (links to the associated requirements), which contain the requirement URL, we access to requirement info. by using REST commands.
    I do not have better answer than this one. If someone has a better idea, I would appreciate.
    Cordially,
    Carlos

  • Query By Example search in Uppercase (value only)

    Hi,
    I am using Jdev 11.1.1.6.
    I need to allow users to use QBE on table (wrapped by PanelCollection) using case-insensitive search.
    My application stores everything in uppercase, so there is no need to put UPPER on database column. So I am looking for solution to only uppercase value entered by user.
    I found one old post by Steve Muench here[http://radio-weblogs.com/0118231/2004/04/16.html#a276]
    private void adjustStringViewCriteriaToUppercaseWildcards() {
        ViewCriteria vc = getViewCriteria();
        if (vc != null) {
          ViewCriteriaRow vcr = (ViewCriteriaRow)vc.first();
          AttributeDef[] attrs = vc.getViewObject().getAttributeDefs();
          int attrCount = attrs.length;
          while (vcr != null) {
            for (int z = 0; z < attrCount; z++) {
              if (attrs[z].getSQLType() == Types.VARCHAR ) {
                String criteria = (String)vcr.getAttribute(z);
                if (criteria != null) {
                  vcr.setAttribute(z,criteria.toUpperCase()+"%");
            vcr = (ViewCriteriaRow)vc.next();
      }Steve suggested to put this method in custom ViewObjectImpl and called from getViewCriteriaClause(), something like this:
    public String getViewCriteriaClause() {
        adjustEnameViewCriteriaToUppercaseWildcards();
        return super.getViewCriteriaClause();
      }I noticed that getViewCriteriaClause() has been deprecated in 11gR1, so I instead implemented it in getViewCriteriaClause(boolean b).
    The problem is that first statement ViewCriteria vc = getViewCriteria(); returns null. My view object does not have any View Criteria. I was expecting the temp VC that is attached by framework during QBE.
    I modified the code to this:
            ViewCriteria[] vcs = getApplyViewCriterias(ViewCriteria.CRITERIA_MODE_QUERY | ViewCriteria.CRITERIA_MODE_CACHE);
            if (vcs != null && vcs.length > 0) {
                for (ViewCriteria vc : vcs) {
                    if (vc != null) {
                        ViewCriteriaRow vcr = (ViewCriteriaRow)vc.first();
                        AttributeDef[] attrs =
                            vc.getViewObject().getAttributeDefs();
                        int attrCount = attrs.length;
                        while (vcr != null) {
                            for (int z = 0; z < attrCount; z++) {
                                if (attrs[z].getSQLType() == Types.VARCHAR) {
                                    String criteria = (String)vcr.getAttribute(z);
                                    if (criteria != null) {
                                        vcr.setAttribute(z,
                                                         criteria.toUpperCase());
                            vcr = (ViewCriteriaRow)vc.next();
            }Now I see that, it is getting the VC and executing vcr.setAttribute(z,criteria.toUpperCase()); on the value that I entered during search but still matched rows are not retrieved.
    When I explicitly put the value in Uppercase on UI then it returns the correct rows.
    What am I doing wrong here? What else do I need to handle here? Is there another way to achieve my usecase?
    Note: If I do vc.setUpperColumns(true) then it returns all rows matching search criteria but the statement is executed with UPPER on both sides of where clause, which is desired behavior but something I don't want as it will not use any index on that column.
    Thanks,
    Jai

    Thanks for the info Timo.
    I did not mention it explicitly but I need this for entire application. I don't need this for my declared bind variables, which are already taking care, but for QBE provided by PanelCollection component where framework attaches temp bind variables. So I don't know the bind variable name to set their values.
    Do you know how to achieve using the method you mentioned in your post?
    Update on Steve's method:
    When I tried to test it using BC Tester (as the post suggests for testing), it worked. Here is what the post says:
    To test out your work, you can use the Business Components Tester tool that's built-into JDeveloper (right-mouse Test... on your application module in the navigator).
    When viewing your view object, their is a "Specify View Criteria" toolbar button that allows you to enter one or more rows of View Criteria query-by-example criteria.It does not work when I invoke QBE from UI using PanelCollection filter component. At that time, first statement [i.e. ViewCriteria vc = getViewCriteria();], in the helper method returns NULL.
    I thought the solution is meant for BC Tester as well as UI but since the post is very old [2004], I am not sure if something has changed on the framework side, which is breaking the logic for UI.
    Question: What is causing this not to work from UI? How can I tweak this method to make it work from UI?
    Any help is appreciated here.
    Thanks,
    Jai

  • Query-by-example Forms 10g

    Hi,
    I'm kind of embarrassed to be asking such a basic question, but here goes.
    In earlier versions of Forms, it was easy to put &A into a field, and on execute query, Forms would pop up a box, and you could write "&a is null" (or some other more complex query fragment) which allowed you do a query for situations were a field was null.
    You can't seem to do this now in forms 10g.
    You can still put "# is null" into a field if the query length is long enough I know, but I have seen no documentation on the loss of this query by example facility.
    We're using v10.1.2 by the way.
    As usual, any help gratefully received.
    cheers
    Tony

    You're right ...
    Found this : http://groundside.com/blog/DuncanMills.php?m=200407 (search for QBE on the page). Not sure what the setting is for 10g - I assume FORMS_RESTRICT_ENTER_QUERY
    Otherwise it is as you say ...
    Steve

  • Query By Example with view object - how?

    Hi all,
    I have a named query "select new model.vo.PatientVO(o) from Patient o", how to write this using Query By Example?
    Entity Patient has complex structure, so PavientVO (we call it "view object", I don't know the official term for this), which is very simplified Patient, is used for displaying the basic data.
    I guess I would still use Patient as example object, but how to tell the query framework to return PatientVOs?
    Thanks,
    Pedja

    You would need to use a ReportQuery with the example object, and add a constructor item to the ReportQuery.
    You could also just use a regular ReadAllQuery and wrap the Patient objects with your PatientVO after.
    James : http://www.eclipselink.org

  • Query by example operators

    Hi,
    Can anyone tell me how I can specifiy the use of the 'OR' or 'IN' operator when using query by example on a database adapter?
    Specifically: I want to execute a query on a single table 'where clientID = 111 or clientID = 222 or clientID = 333' or 'where clientID in (111,222,333)'.
    I'm using an XML Fragment to bind the input for the adapter in BPEL 10.1.2
    Any help would be appreciated.
    Thanks, Rob

    Hi,
    I am facing your same problem. I would like to make a query like
    select * from student where student_id IN (100, 101, 102)
    but I don't know how to dinamically pass the input params.
    Did you manage to solve the problem?
    Thanks
    Matteo

Maybe you are looking for

  • Mac OS X v10.5: Fonts not displaying correctly

    i'm not sure if this is a leopard problem or something else all together in the last couple of weeks i have had strange symbols popping up within certain programs. for example on some web pages, these include wikipedia and one of news pages which com

  • Java.lang.IllegalArgumentException: Cannot invoke beans

    in 1 jsp page <logic:iterate id="msgg" name="messages"> <tr> <td>${msgg.messageNumber}</td> <td>${msgg.from[0]}</td> ** <td><html:link action="msgbody?message=${msgg.message}">${msgg.subject}</html:link> </td> <td>${msgg.sentDate}</td> </tr> </logic:

  • Color ID doc prints MOST elements in gray scale.

    Please help.  I'm at the end of my rope.  Deadline looming. I have an ID document that is ALL color.  When I go to print it, no matter if it's set for ID color management or printer color management, most elements of the page come out in gray scale. 

  • Which version of Oracle8i?

    Greetings, I want to install Oracle 8i EE on Solaris Intel platform. From where do I download the software? In the OTN downloads, all the versions are for Sparc or NT. Thanks null

  • Does the iPad mini do the samethings as a computer?

         My mother got me a Ipad mini to show that she's proud of me...but i told her i didn't want it since i already have an Ipod, and that we don't have the extra money for it. She told me it was either the Ipad mini or a computer. That's when i was w