Query By Example and LOV

Hi all,
I need to do query by example and let the user choose from the LOV before executing the query. I want the user to click on the button that will make the form enter the query mode and then lauch the LOV automatically. I tried to make LOV automatic display on but it would result the LOV to be display again after I execute the query.
Thanks in advance for your help.

Write a trigger that openes the LOV using show_lov builtin.
Then use the value that is returned in a set_block_property('block',DEFAULT_WHERE...)
builtin. and then issue an execute_query.
you then don't need to go into enter query mode.
(If you return the LOV value to a field you might want to clear the block before you execute query or you'll get asked to save your changes.

Similar Messages

  • Query by example and outer join supported?

    Does TopLink support outer joins when using query by example and cursored streams? I am having problems getting this to work. It seems to completely ignore the requested outer join.
    I have tried several variations of what is below, but have never seen TopLink generate the outer join. This is against Oracle 9i on TopLink 9.0.4.5.
    Customer 1->1 Address (using valueholder indirection)
    ReadAllQuery q = new ReadAllQuery();
    q.setReferenceClass(Customer.class);
    QueryByExamplePolicy policy = new QueryByExamplePolicy();
    policy.addSpecialOperation(String.class, "like");
    q.setQueryByExamplePolicy(policy);
    ExpressionBuilder builder = q.getExpressionBuilder();
    Expression addressExp = builder.getAllowingNull("address");
    q.addJoinedAttribute(addressExp);
    q.addOrdering(addressExp.get("city").ascending());
    q.useCursoredStream(end-start, end-start);
    q.setExampleObject(exampleCustomer);
    CursoredStream stream = (CursoredStream)s.executeQuery(q);
    ...iterate through the stream...
    Note, that the database level relationship is expressed through a target foreign key.
    (     addressMapping.addTargetForeignKeyFieldName("ADDRESS.CUSTOMER_ID", "CUSTOMER.CUSTOMER_ID");)
    Any help would be appreciated.
    Thanks,
    Kevin

    Kevin,
    I spoke too soon. All you need to do is use the getAllowingNull in the ordering expression and not use the addJoinedAttribute. With this you can use query-by-example with additional outer-joined ordering.
    Here is an example based on the Employee demo:
    ReadAllQuery raq = new ReadAllQuery(Employee.class);
    ExpressionBuilder eb = raq.getExpressionBuilder();
    raq.addOrdering(eb.getAllowingNull("address").get("city").ascending());
    Employee exampleEmp = new Employee();
    exampleEmp.setLastName("%");
    // My default constructor populates the period so I'll null them so
    // they are not included in the selection criteria of the example object
    exampleEmp.getPeriod().setStartDate(null);
    exampleEmp.getPeriod().setEndDate(null);
    QueryByExamplePolicy policy = new QueryByExamplePolicy();
    policy.addSpecialOperation(String.class, "like");
    raq.setQueryByExamplePolicy(policy);
    raq.setExampleObject(exampleEmp);
    List emps = (List) session.executeQuery(raq);
    I hope this helps,
    Doug

  • Query By Example and security issues

    HI,
    I have started looking at security issues in our ADF application.
    Is the default implementation of Query By Example (QBE) on a table safe from Cross Site Scripting and SQL Injection?
    In other words, can a user enter some value in a QBE input field that can either:
    - execute a malicious script (CSS)
    Or
    - somehow change the underlying will change the SQL query
    I am more worried about SQL Injection as QBE takes input from a web user, and makes a corresponding SQL query to the database.
    Are there any ways to prevent any of these?
    Thanks

    Timo thanks for your answer.
    So far I am confident on the following (based on responses and other reading):
    1) default implementation of Query By Example (QBE) (e.g. search fields) is "safe /safer" from/on SQL injection issues.
    2) User entered data  via non QBE fields (I assume this is "For other input text you" Timo mentions) should by checked against special characters (> < etc) to "prevent " cross side scripting.
    However, should I do 2) for QBE filters on alphanumeric columns (default implementation) ? I can do it, but if I do it I would loose some searching functionality
    as >, < are valid wildcard characters.
    Thanks

  • Query Bind Parameters and LOV's [JHS 10.1.3.1]

    Using the JHeadstart Developer's Guide instructions (starting section 3-69) I have started to learn and then implement Query Bind Parameters in JHeadstart - but I am being met with nothing but troubles.
    Is there anything 'special' that I have to do in order to get a query bind parameter to work with a LOV? I have followed the instructions in the Developer's Guide but just replaced the bind parameters that would otherwise be in a Dynamic Domain into a LOV group in the JHeadstart Application Definition file..
    To be precise about all of this, I have been trying to get this to work with the HR database schema. So, like in the mini-tutorial I have a query bind parameter on a Employee table View Object set as a LOV to the ManagerId field on the Departments View Object (set in Form View).
    What is actually happening when I open up my LOV, is that no rows are ever displayed in the LOV pop-up window.
    What am I doing wrong?

    Michael,
    Take a look at this thread:
    Re: Group Used as LOV does not return records
    You have to use a managed bean to "communicate" the value of the Employees base page to the LOV page definition.
    Steven Davelaar,
    Jheadstart Team.

  • Query by example questions

    I have a couple questions. I have been using query by example and I really like it. What I want to do though I haven't seen, and i am new enough to toplink that i dont know the best way to do it.
    Say I have a table t with 1 column (name : varchar2)
    What I want to do is a query on name using the like operator (I know how to do this), what I dont know how to do is tell it to ignore case. So for example
    select * from t where upper(name) like 'BU%'; something to this effect.
    Any help greatly appreciated. If I cant do this with query by example which query method would you suggest?

    If you use a QueryByExamplePolicy, you should be able to specify to use likeIgnoreCase for String.
    i.e.
    queryByExamplePolicy.addSpecialOperation(String.class, "likeIgnoreCase");
    If you were using the Expression API this would be,
    builder.get("name").toUpperCase().like("BU%");
    or,
    builder.get("name").likeIgnoreCase("BU%");

  • Simple SQL Query and Parameters and LOV

    Newbie and trying to work thru building a simple sql query with a single table query and use a parameter and lov.
    Can anyone point me to an example.
    simple query:
    select cust_id, name_desc, name_add1, name_add2, name_city
    from customer_table
    where cust_id = :cust_parm
    This works in straight sql and in the query builder by prompting for the customer ID. When building a parameter using LOV or search, it doesn't seem to detect the variable.
    Thanks..
    DD

    If you are using version 11g, then as soon as you save the query in the data model, it should notice the parameter and ask if you want to add the parameter to the data model. What version of BIP are you using?
    What happens if you exclude the parameter from the query and simply hard-code the criteria? Can you generate XML data?
    From your wording, it sounds like you're trying to create a parameter from the LOV dialog. LOVs and parameters are totally distinct. After each are created separately, then you configure the parameter to use the LOV.

  • POST-QUERY and LOV

    Hi,
    I created a POST-QUERY trigger on a LOV field; I have checked off “Validate from list”, so the user is forced to use the LOV. However every time a user retrieves a record, and then tries to re-query, they get the message, “Do you want to save the changes you have made?” I assume this is because of the POST-QUERY trigger; when I uncheck the “Validate from list” the forms runs correctly. Is there anyway to use the validate from list function, but without the save message?
    Thanks in advance.
    ===POST-QUERY===
    declare
         --Country of Birth
         cursor lookup_cob is select codetext
         from country
         where code = :app.country_birth;
    begin
         --Country of Birth
         open lookup_cob;
         fetch lookup_cob into :app.txtcob;
         close lookup_cob;
         exception
         when no_data_found then
              null;
         when others then
              message(sqlerrm);
    end;

    If I have more than one procedure in my POST-QUERY trigger then I have to insert this code multiple times?
    SET_ITEM_PROPERTY('block_name.item_id1',ITEM_IS_VALID,PROPERTY_TRUE);
    SET_ITEM_PROPERTY('block_name.item_id2',ITEM_IS_VALID,PROPERTY_TRUE);

  • View criteria and LOVs

    Hi I am very new to ADF and just getting started on view criteria and LOVs. Is it possible to create a query panel and table such that in the search section the fields have drop down boxes or select many shuttles ? Right now what ever criteria i give is coming as only text boxes. I want for some fields there must be values retrieved from database and shown as drop down list and for another field I need it to be shown as SelectManyShuttle.
    Any suggestions or examples should be helpful.
    Thanks,
    Ravi.

    Hi Ravi,
    Sure, there is a way to do this. The attributes in your ViewCriteria should have LOV defined on them to show dropdown list for that attribute. When you include that attribute in your VC, it will show as selectOneChoice or whatever you have defined the LOV as.
    This might help:
    http://docs.oracle.com/cd/E23943_01/web.1111/b31974/web_search_bc.htm
    Thanks.
    -Nirav

  • Item Source Display and LOV

    I have an item that is of type 'Select List'. When I branch to the page I would like the value stored in the database to be the default value displaying but instead a random value in the LOV is displaying. I have entered my sql query in the Source field but it is not pulling and displaying that value as the default when I branch to the page.
    Example
    Item: P500_status
    Source Query: Select status from table where id=:p500_id
    Dynamic LOV: select distinct status from table
    Source Query Result: Open
    Dynamic LOV Result: Closed, Open, Pending, Reopened...
    When the page displays, the item has the value of 'Closed' in it rather than displaying 'Open' and then listing the others in the drop-down. Is Source supposed to be ignored in this case?

    Thanks for your quick responses. The example I posted above was an abbreviated version of what I'm trying to do.
    Here is the URL:
    http://dragon:7778/pls/htmldb/f?p=201:6005:378973494406918986::NO::P6005_FIELD_VALUE_ID:38
    This is the section from below that I am interested in. The value that should default in the box is 'Priority' but 'Field' is the value that it is defaulting to.
    0.06: FORMITEM: P6005_FIELD_PARENT COMBOBOX
    Field Parent Fields Status Category Priority Cause Current Status Module Groups Product
    Debug Output:
    0.01: S H O W: application="201" page="6005" workspace="" request="" session="378973494406918986"
    0.01: ...Language derived from: FLOW_PRIMARY_LANGUAGE, current browser language: en-us
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: ...Setting NLS Decimal separator="."
    0.02: NLS: Language=en-us
    0.02: Application 201, Authentication: CUSTOM2, Page Template: 5788518891782227
    0.02: ...Determine if user ADMIN with SGID 773723725112169 can develop application 201 in workspace 773723725112169
    0.02: ...ok to reuse builder session for user:HTMLDB_PUBLIC_USER
    0.02: ...Application session: 378973494406918986, user=HTMLDB_PUBLIC_USER
    0.02: ...Determine if user ADMIN with SGID 773723725112169 can develop application 201 in workspace 773723725112169
    0.02: Fetch session header information
    0.03: Branch point: BEFORE_HEADER
    0.03: Fetch application meta data
    0.03: ...fetch page attributes: f201, p6005
    0.03: Fetch session state from database
    0.04: Computation point: BEFORE_HEADER
    0.04: Processing point: BEFORE_HEADER
    0.04: Show page template header
    0.05: Computation point: AFTER_HEADER
    0.05: Processing point: AFTER_HEADER
    Print
    Logout
    HTMLDB_PUBLIC_USER
    0.05: Computation point: BEFORE_BOX_BODY
    0.05: Processing point: BEFORE_BOX_BODY
    0.05: Region 1:Edit Selected Field Edit Selected Field Delete
    Save
    0.05: FORMITEM: P6005_FIELD_VALUE_ID TEXT Field Value Id
    0.06: FORMITEM: P6005_FIELD_PARENT COMBOBOX
    Field Parent Fields Status Category Priority Cause Current Status Module Groups Product
    0.06: FORMITEM: P6005_FIELD_NAME TEXT_DISABLED
    Field Name
    0.06: Region 2:Create New Create New Create
    0.07: FORMITEM: P6005_NEW_FIELD_NAME TEXT Field Name
    0.07: Computation point: AFTER_BOX_BODY
    0.07: Processing point: AFTER_BOX_BODY
    0.07: Computation point: BEFORE_FOOTER
    0.07: Processing point: BEFORE_FOOTER
    0.07: Show page tempate footer
    Edit ApplicationEdit Page 6005NewSessionNo DebugHide Edit LinksShow Edit Links
    0.07: Computation point: AFTER_FOOTER
    0.07: Processing point: AFTER_FOOTER
    0.07: Log Activity:
    0.07: End Show:

  • Whats the difference between list and lov ?

    Whats the difference between list and lov ?
    i can do the same things with a list what an lov can do .
    infact a list is more better. cause the list doesnt hold/show a range of values, and only has the items value iteself.
    while the lov can get all the values of items depending on the query.
    like
    select ename, job, sal from emp
    will show all the three items values in lov?

    Also, if you're looking in the US store, the prices are:
    - Airport Express (small, no ac) $99 - Has audio out for speaker connection using Airplay. Can share a USB printer only.
    - Airport Extreme (larger, ac) $199 - No audio out, can share a USB printer or hard drive.
    - Time Capsules (2TB, 3TB at $299, $399) - have ac wireless and a backup hard drive for Time Machine which the other Airports do not have.
    Matt

  • 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

  • Query for PO and GPRO

    Hi guys. I am relatively new to SAP Business with less than one month experience handling this software. I was given a task by my superior last week, whereby I was asked to create a query that will enable both PO and GRPO "combine" together, thus enabling my colleagues to skip the tradition manual way of doing things.
    I have tried a first code which I manage to combine both PO and GRPO. However, there is this problem whereby should I link it via the coding I have done, both specific PO and GRPO must exist on the database for it to be listed out on the query (Should PO is present but GRPO is not, then it do not appear on the query). Below is the code that I have done:
    SELECT T0.[DocNum] as 'PO No.', T0.[DocDate], T0.[DocStatus], T0.[CardName] as 'Supplier', T1.[ItemCode], T1.[Quantity], T1.[Price], T1.[LineTotal] as 'Total Amount', T1.[U_Ship_ETA] as ' Expected Arrival Date',T2.[WhsCode], T2.[OrderedQty], T2.[DelivrdQty], T3.[DocNum] as 'GRPO No.' FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN PDN1 T2 ON T1.DocEntry = T2.BaseEntry AND T1.LineNum = T2.BaseLine INNER JOIN OPDN T3 ON  T2.DocEntry = T3.DocEntry WHERE T1.[U_Ship_ETA] >= [%0] AND T2.[WhsCode] = 'PE-PG'
    The entire purpose of this assignment is to create a query that will facilitate the work of my colleague in HQ and warehouse. This specific person in HQ should be able to key in the PO then followed by another person on warehouse aware of the supply arrival date (expected) and to fill up the GRPO. The coding above, require both PO and GRPO to be present at the same time, which resulting in my colleague at warehouse unaware of the expected arrival date from PO.
    Edited by: AlexAkane on Oct 27, 2009 10:17 AM

    Second question:
    Due to this, I have recreated two different query. One query on PO and another on GRPO. Below are the coding for both,
    GRPO Tracking
    SELECT T0.[DocNum] as 'GRPO', T0.[DocStatus], T0.[DocDate], T0.[CardName] as 'Supplier',T1.[ItemCode], T1.[OrderedQty] as 'Ordered Quantity', T1.[DelivrdQty] as 'Delivered Quantity' , T1.[OpenQty] 'Remaining Open Quantity',T1.[WhsCode], T1.[U_Job_No] FROM OPDN T0  INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[WhsCode] =[%0] ORDER BY T0.[CardName]
    PO Tracking
    SELECT T0.[DocNum] as 'PO Number', T0.[DocDate], T0.[DocStatus], T0.[CardName] as 'Supplier', T1.[ItemCode], T1.[Quantity] as 'Ordered  Quantity', T1.[Price] as 'Price Per Unit', T1.[LineTotal] as 'Total Amount' , T1.[WhsCode], T1.[U_Ship_ETA] as 'Expected Arrival Date' FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[WhsCode] =[%0]
    I would like to know, is it possible to join into a single table?  Example- A and B . Join become AB.
    Sorry for this long post. I just don't know how to put in simpler words :). And I would appreciate any help or advice.
    Thank You !
    Regards,
    Alex
    Edited by: AlexAkane on Oct 27, 2009 10:16 AM

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

  • Bind vars and LOVs on same JSP -incompatible?

    I have managed to get a project working using bind variables, and another project working that has LOV. (Both using ADF,struts,JSP)
    However, when I try and use bind variables for one attribute and an LOV for a different attribute on the same JSP I get the error msg:
    No getter method available for property x for bean name org.apache.struts.taglib.html.BEAN
    at org.apache.struts.taglib.SelectTag.calculateMathcValues(SelectTag.java:327)
    Is it not possible to have bind vars and LOVs on the same page or have I just messed sthg up?(more likely...) Seems weird that I can get them working separately. Any help appreciated... not knowing Java I'm rather at my wits end...!

    Hi kian chye,
    unfortunately it is not possible to use the page item bind variable in shared components for more than one page.
    If you want to get it to work you have to use application item in the LOV (shared components).
    Then on change of the first selection (region) you should write the new selection (region) into the application item (maybe with a javascript code). Then the LOV of the city should work.
    For the javascript code see an example here:
    http://apex.oracle.com/pls/otn/f?p=31517:119
    Regards,
    Denise
    www.appsassociates.de

  • 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

Maybe you are looking for

  • Report Server 6i and Portal 3.0

    I read through several white papers including "Security Tips in Oracle Reports Services Release 6i with Oracle Portal Release 3.0" and tried to start Reports server with no success but maybe I'm misunderstanding how it works. So I have the following

  • Flash no longer working on Firefox after update

    Moments ago I installed the Flash update after it came up on my screen asking to update, after doing so Flash is no longer working on Firefox, it works fine on other browsers. I cant view videos, look at flash objects etc. It was working perfectly fi

  • Why doesn't my iTunes Remote App point to my iCloud content?  Why does it have to point to my iTunes content on my PC?

    Hi, I just set up a 3rd-gen Apple TV.  W/ iTunes Match & Home Sharing, I'm able to play my songs or TV shows on my TV. Then, I installed the Apple Remote app on my iPad.  It points to my Apple TV but then can displays & plays only the songs, not the

  • PDF based payment advise

    Hi In our scenario, for EDI payments (BACS) system should generate payment advise in PDF format and same should be sent to vendor by mail.  For EDI Payments I have configured payment method 'E' - BACS Transfer and attached Payment Medium Work Bench G

  • On the billing of refusal....

    Hi all, on the billing of refusal biling doc is generated for every line,It means that for each item you have each 'account' and 'credit for returns' document.How to make that all the items would be only one document? Thanks in advance William