Named View Criteria with no wizard - I write the SQL

Using JDeveloper/ADF 11.1.2.3.
Is there a way to create a named View Criteria with a SQL Select that is more complex than the wizard can write?
I know that I can write code to create a View Criteria at runtime, but then I can't just drag and drop it like a named one.
One use case:
I have a table named FACILITIES, with a detail table named FACILITY_SERVICES. I want a view criteria for FACILITIES that finds all facilities that have all the required services in a bind variable that is a comma delimited list.
WHERE list.to_vc_array(:requiredServices) /* I wrote this function to translate a comma delimited list to my own vc_arraytype. */
   SUBMULTISET OF
      CAST(MULTISET ( SELECT service
                        FROM facility_services
                       WHERE facilities.facility_id = facility_services.facility_id)
           AS vc_arraytype)With the wizard, I can't even write a simple IN query (match at least one of the required services), much less this more complex one (match ALL the required services).

I'm not sure that this is so bad :)
You need to implement one interface and override one method.
For example:
public class YourVOImpl extends ViewObjectImpl implements ViewCriteriaAdapter {
    protected void create() {
        super.create();
        setViewCriteriaAdapter(this);
    @Override
    public String getViewCriteriaClause(ViewObject viewObject, ViewCriteria viewCriteria) {
        if (viewCriteria == null || viewCriteria.size() == 0) return null;
        return "list.to_vc_array(:requiredServices)\n" +
                  "   SUBMULTISET OF \n" +
                  "      CAST(MULTISET ( SELECT service\n" +
                  "                        FROM facility_services\n" +
                  "                       WHERE facilities.facility_id = facility_services.facility_id)\n" +
                  "           AS vc_arraytype)");
}Dario

Similar Messages

  • Named View Criteria and Range paging don't work together

    Hi,
    I am using a named view criteria for a view whose access mode is set to range paging.
    When I use the named view criteria on my page to do a search I am getting the below error. If I don't use range paging as access mode for the view I don't get this error. Looks like when I use the search it doesn't pass the row numbers properly and they are not set in the query.
    Is this a known issue or am I missing something?
    Thanks
    SQL error during statement preparation.  Statement: Select *
      From (Select /*+ FIRST_ROWS */
             IQ.*, ROWNUM As Z_R_N
              From (Select Persons.PRINCIPAL_NAME,
                           Persons.PERSON_ID,
                           Persons.TITLE,
                           Persons.FIRST_NAME,
                           Persons.LAST_NAME,
                           Persons.PHONE_NUMBER
                      From PERSONS Persons
                     Where ((((UPPER(Persons.FIRST_NAME) Like UPPER('%' || :p_name || '%')) Or (:p_name Is Null))))) IQ
             Where ROWNUM < :1)
    Where Z_R_N > :2
    Missing IN or OUT parameter at index:: 4 Message was edited by:
    Muhammed Soyer

    Hi Frank,
    I didn't test it in 10g. It was something that I came across and thought that it might be a known issue..
    The query is not something that I built manually. My entity is created from a table and my view is using the entity. I added a Named Criteria to the view and used Range Paging as access mode for the view.
    The actual query is this
    SELECT Persons.PRINCIPAL_NAME,
           Persons.PERSON_ID,
           Persons.TITLE,
           Persons.FIRST_NAME,
           Persons.LAST_NAME,
           Persons.PHONE_NUMBER
    FROM PERSONS Persons

  • Write the sql query to find largest value in row wise without using   great

    write the sql query to find largest value in row wise without using
    greatest fuction?

    Another not so good way, considering you want greatest of 4 fields from a single record:
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (Select 100 col1,200 col2,300 col3,400 col4 from dual
      2  union select 500,600,700,800 from dual
      3  union select 900,1000,1100,1200 from dual
      4  union select 1300,1400,1500,1600 from dual
      5  union select 1700,1800,1900,2000 from dual
      6  union select 2100,2200,2300,2400 from dual
      7  union select 2800,2700,2600,2500 from dual
      8  union select 2900,3000,3100,3200 from dual)
      9  SELECT (CASE WHEN col1 > col2 THEN col1 ELSE col2 END) Max_value
    10  FROM
    11  (SELECT (CASE WHEN col1_col2 > col2_col3 THEN col1_col2 ELSE col2_col3 END) col1,
    12         (CASE WHEN col2_col3 > col3_col4 THEN col2_col3 ELSE col3_col4 END) col2,
    13         (CASE WHEN col3_col4 > col4_col1 THEN col3_col4 ELSE col4_col1 END) col3
    14  FROM
    15  (SELECT (CASE WHEN col1 > col2 THEN col1 ELSE col2 END) col1_col2,
    16         (CASE WHEN col2 > col3 THEN col2 ELSE col3 END) col2_col3,
    17         (CASE WHEN col3 > col4 THEN col3 ELSE col4 END) col3_col4,
    18         (CASE WHEN col4 > col1 THEN col4 ELSE col1 END) col4_col1
    19* FROM t))
    SQL> /
    MAX_VALUE
           400
           800
          1200
          1600
          2000
          2400
          2800
          3200
    8 rows selected.
    SQL> Edited by: AP on Sep 21, 2010 6:29 AM

  • Help to write the sql server 2012(business intelligence ) certification.

    Hi,
    I am planning to write the SQL SERVER 2012 certification exam.
    i want few more details...
    1. Examination code.
    2. how to prepare
    3. is there any dumps available.
    4. is there any books available for preparation.
    Please pass the details, it would be very help full for me..

    The Business Intelligence exams are:
    70-461: Querying Microsoft SQL Server 2012
    70-462: Administering Microsoft SQL Server 2012 Databases
    70-463: Implementing a Data Warehouse with Microsoft SQL Server 2012
    70-466: Implementing Data Models and Reports with Microsoft SQL Server 2012
    70-467: Designing Business Intelligence Solutions with Microsoft SQL Server 2012
    Ramesh Babu Vavilla MCTS,MSBI

  • Need help in writting the sql

    The sql
    select 'alter system kill session '||sid||','||serial#||';' from v$session where username= 'EV05';
    give the output in the below given form
    alter system kill session 69,38769;
    But i need the output to be
    alter system kill session '69,38769';
    Can some one re-writes the sql select statment,
    Thanks
    Naveen

    Naveen,
    This isn't the forum for help with writing SQL - rather with using the SQL Developer product. In future, I would suggest that you use the SQL and PL/SQL forum for these sorts of questions.
    However, to answer your question this time, you can include a ' in a string by having two together ie 'fred''s' will return the string fred's.
    The following SQL will give you the result you want:
    select 'alter system kill session '''||sid||','||serial#||''';' from v$session where username= 'EV05';

  • How to write the sql statement of my finder function in cmp?

    hi,
    I create a cmp ejb from table INFOCOLUMN,and I create a my finder function ,which sql statement is :
    select * from INFOCOLUMN WHERE employee_id=id
    employee_id is a column of the table,and id is the finder function parameter.
    The error is : invalid column name
    So,how to write the sql statement.
    Thanks .

    Mole-
    Bind variables are of the form $1, $2, etc., so your query stmt should look like:
    select * from INFOCOLUMN WHERE employee_id=$1
    -Jon

  • View criteria with date field in ADF

    Hi ADF Experts,
    I have a requirement like.I have a VO with query let say  "Select * from Employee"
    I have created viewCriteria in that VO like "HireDate between 'abc' and 'XYZ'.
    In AMImpl class I have written, one fuction to apply viewcriteria on VO and execute query.
    Expose that function as service method, and execution form backing bean.
    It is working properly for all other column except the date field.(May be beause of date format, as we cannot apply To_Char, or ToDate in view criterai for date format)
    Tried all possible combination but no luck
    Please help

    Hi,
    The below link might be helpful for you
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/59-table-filter-by-data-range-176653.pdf
    Thanks
    Prabhat

  • Import Excel with Import Wizard / Problem during the import of "Actual Work" column

    Hello,
    I am trying to import an Excel File (*.xlsx) to Project Server 2013 through Project Professional 2013 and Import Wizard.
    I am having trouble when I try to include the column "Actual Work". After selecting the columnsmapping I am getting a strange error message saying that "The File cannot be oppened","Make sure, that the Filename and Path is right"
    and some other strange messages concerning compatibility, although I am using the same File, which works perfectly without the "Actual Work" column.
    I have tried as well with csv and the outcome was the same.
    Any help is welcome!
    Thank you in advance,
    Ioannis

    Which DW are you using - DMX on Mac? It didn't have that
    option. This is
    not an Educational version issue - it's a Mac issue.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Terry_Straehley" <[email protected]> wrote
    in message
    news:fm85u9$5ec$[email protected]..
    > From a 11/06 post
    > <<Hi, My Dreamweaver MX Education Version does NOT
    have the Import to
    > Excel
    > option. I am using "Excel 2003 (11.6560.6568) SP2, Part
    of Microsoft
    > Office
    > Professional Edition 2003". If I start with a blank page
    in Dreamweaver,
    > click
    > on File, Import, I only have the options "XML into
    Template", "Word HTML,
    > and
    > "Tabular Data". Does anyone know why I don't have the
    "Import Excel" >>
    >
    > This was not answered in the thread I copied it from. I
    have the same
    > problem.
    > Can some one answer the question?
    >

  • How to write the SQL codes  of the login system for a database system

    If I have a table stored with a Column staff_ID and Password. How can I make use of this 2 columns information to setup the login system?

    Hi,
    Create Table Modules          -----e.g. payroll, inventory etc.
    (ModID    NUMBER(10),
    ModName  VARCHAR2(50)); 
    Create Table Modules_Forms    ------e.g. Sales Transaction Form
    (FormID   NUMBER(10),
    ModID    NUMBER(10),
    FmxName  VARCHAR2(32));           
    Create Table Modules_Reports  ------e.g. Sales Report
    (RepID    NUMBER(10),
    ModID    NUMBER(10),
    RepName  VARCHAR2(32));           
    Create Table Usr              ------------From the Employee Information Module
    (UserID   VARCHAR2(20),       ------------you can find the designation of
    Password VARCHAR2(10)        ------------the user who wants to connect
    Emp_Code Varchar2(25));      ------------that is why, I am Addng Emp_Code.
    Create Table User_Modules     ------------Control the Module Access.
    (UserID   VARCHAR2(20);
    ModID    NUMBER(10),
    Access   VARCHAR2(1));
    Create Table User_Forms       ------------Control the Forms Access
    (UserID   VARCHAR2(20),
    FormID   NUMBER(10),
    Read     VARCHAR2(1),
    Write    VARCHAR2(1),
    Execute  VARCHAR2(1),
    Delete   VARCHAR2(1));
    Create Table User_Reports     ------------Control the Report Access
    (UserID   VARCHAR2(20),
    RepID    NUMBER(10),
    Access   VARCHAR2(1));
    1 ) After Creating these Tables, Control the Application Access of the users
        From the application (Oracle Forms).
    2 ) I think you should create a Menu from oracle forms.
    3 ) For Controlling the Database Level Access, you can create a ROLE
    4 ) Forms Forum Site:-
        http://www.forums.oracle.com/forums/forum.jsp?forum=82Regards
    Muhammad Waseem Haroon
    [email protected]

  • How to write the SQL query for generating triangular numbers

    Hi,
    I have a table ..which stores the sequence number like this
    Seq :
    1000
    1200
    1300
    1500
    1800
    1900
    Now i want to get a result like this
    1000 1000
    1200 2200
    1300 3500
    1500 5000
    1800 6800
    1900 8700
    how can it be achieved. I tried using Lead and lag. but only I can add the n+1 or n-1 results. Please help.

    I've never heard it called 'triangular numbers' before but I think you're looking for a 'running total':
    SQL> WITH data AS
      2  (
      3     SELECT 1000 AS num FROM dual UNION ALL
      4     SELECT 1200 AS num FROM dual UNION ALL
      5     SELECT 1300 AS num FROM dual UNION ALL
      6     SELECT 1500 AS num FROM dual UNION ALL
      7     SELECT 1800 AS num FROM dual UNION ALL
      8     SELECT 1900 AS num FROM dual
      9  )
    10  /* END SAMPLE DATA */
    11  SELECT num, SUM(num) OVER (ORDER BY num) AS running_total
    12  FROM   data
    13  ORDER BY 1
    14  ;
           NUM RUNNING_TOTAL
          1000          1000
          1200          2200
          1300          3500
          1500          5000
          1800          6800
          1900          8700
    6 rows selected.

  • How to write the SQL for the following

    ID     PRODUCT     LEAD_FLAG     SALES_VOLUME
    1     A     Y     100
    1     B     N     200
    1     C     N     300
    1     D     N     400
    2     A     N     10
    2     B     Y     20
    2     C     N     30
    2     D     N     40
    I need to calculate the incentive for each ID. The rule is for an ID:
    if the the lead flag for a product is N, then check the sales_volume of the product whose lead_flag is Y (product A in case of ID 1, product B in case of ID 2). if the sales_volume of the product with lead_flag = Y is greater than a NUMBER (this NUMBER varies from product to product. for product A it is 20, for product B it is 25, C it is 30 and D it is 40) then incentive = (sales_volume of the product with lead flag N) * 100.

    Hello, I presume the NUMBER you refer to will be held in a table column somewhere? I'm calling it threshold_num in the test data below (and rec_id instead of ID):
    WITH test_data AS (
    SELECT 1 REC_ID, 'A' PRODUCT, 'Y' LEAD_FLAG,  100 SALES_VOLUME FROM DUAL UNION ALL
    SELECT 1, 'B','N', 200 FROM DUAL UNION ALL
    SELECT 1, 'C','N', 300 FROM DUAL UNION ALL
    SELECT 1, 'D','N', 400 FROM DUAL UNION ALL
    SELECT 2, 'A','N', 10 FROM DUAL UNION ALL
    SELECT 2, 'B','Y', 20 FROM DUAL UNION ALL
    SELECT 2, 'C','N', 30 FROM DUAL UNION ALL
    SELECT 2, 'D','N', 40 FROM DUAL),
    test_ref_data AS (
    SELECT 'A' PRODUCT, 20 threshold_num FROM DUAL UNION ALL
    SELECT 'B', 25 FROM DUAL UNION ALL
    SELECT 'C', 30 FROM DUAL UNION ALL
    SELECT 'D', 40 FROM DUAL)
    -- end test data
    SELECT td1.REC_ID, td1.PRODUCT, CASE WHEN td2.PRODUCT IS NOT NULL THEN td1.sales_volume * 100 ELSE 0 END incentive
      FROM test_data td1
       LEFT JOIN (
        SELECT td2.PRODUCT, SUM(sales_volume) sales_volume
         FROM test_data td2
         JOIN test_ref_data trd
            ON (td2.PRODUCT = trd.PRODUCT)
       WHERE td2.lead_flag = 'Y'
        GROUP BY td2.PRODUCT, trd.threshold_num HAVING SUM(td2.sales_volume) > trd.threshold_num) td2
        ON (td1.PRODUCT = td2.PRODUCT)
    WHERE td1.lead_flag = 'N';
        REC_ID PROD  INCENTIVE
             2 A       1000
             2 D          0
             1 D          0
             1 B          0
             2 C          0
             1 C          0
    6 rows selected.And two tips: it's always helps to put {noformat}{noformat} before and after your code for readability, and also to provide expected sample output.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to write the SQL?

    I have a nested table as following:
    create type mytype as table of number(5,0);
    create table test(
    a number(5),
    b mytype
    nested table b store as test_b_tab;
    And the table has the following dataF
    a b
    1 1
    2
    3
    Q1. If I wanna delete b = 3 where a = 1. What should I do in SQLH
    Q2. If I wanna set b = 8 where a = 1 and b = 3. What should I do in SQL?
    Give me a hand, please.
    And thank you first!

    HI,
    SEE HOW TO WORK ON NESTED AND VARRAY TABLES AND WRITE YOUR QUERIES AS YOUR WISH.......
    --//CREATING THE VARRAYS AND NESTED TABLES
    --//AND DOING THE DML OPERATIONS ON IT     
    SQL> create type book as object(id number, name varchar2(20));
    2 /
    Type created.
    SQL> create type booklist as varray(10) of book;
    2 /
    Type created.
    SQL> create type booklisttab as table of book;
    2 /
    Type created.
    SQL> create table my_tabv(slno number(10) primary key, name varchar2(20), books booklist);
    Table created.
    SQL> create table my_tabnst(slno number(10) primary key, name varchar2(20), books booklisttab)
    2 nested table books store as books_store;
    Table created.
    SQL> INSERT INTO MY_TABV VALUES (1, 'KHALEEL',BOOKLIST(BOOK(1,'ENGLISH'),BOOK(2,'HINDI')));
    1 row created.
    SQL> INSERT INTO MY_TABV VALUES (2,'MOHAN',BOOKLIST(BOOK(1,'ENGLISH'),BOOK(2,'TELUGU')));
    1 row created.
    SQL> INSERT INTO MY_TABV VALUES (3,'SRIDHAR',BOOKLIST(BOOK(1,'SANSCRIT'),BOOK(2,'TAMIL')));
    1 row created.
    SQL> INSERT INTO MY_TABNST VALUES(1,'KHALEEL',BOOKLISTTAB(BOOK(1,'ENGLISH'),BOOK(2,'HINDI')));
    1 row created.
    SQL> INSERT INTO MY_TABNST VALUES(2,'MOHAN',BOOKLISTTAB(BOOK(1,'ENGLISH'),BOOK(2,'TELUGU')));
    1 row created.
    SQL> INSERT INTO MY_TABNST VALUES(3,'SRIDHAR',BOOKLISTTAB(BOOK(1,'SANSCRIT'),BOOK(2,'TAMIL')));
    1 row created.
    SQL> SQL> SELECT * FROM MY_TABV;
    SLNO NAME
    BOOKS(ID, NAME)
    1 KHALEEL
    BOOKLIST(BOOK(1, 'ENGLISH'), BOOK(2, 'HINDI'))
    2 MOHAN
    BOOKLIST(BOOK(1, 'ENGLISH'), BOOK(2, 'TELUGU'))
    3 SRIDHAR
    BOOKLIST(BOOK(1, 'SANSCRIT'), BOOK(2, 'TAMIL'))
    SQL> SELECT * FROM MY_TABNST;
    SLNO NAME
    BOOKS(ID, NAME)
    1 KHALEEL
    BOOKLISTTAB(BOOK(1, 'ENGLISH'), BOOK(2, 'HINDI'))
    2 MOHAN
    BOOKLISTTAB(BOOK(1, 'ENGLISH'), BOOK(2, 'TELUGU'))
    3 SRIDHAR
    BOOKLISTTAB(BOOK(1, 'SANSCRIT'), BOOK(2, 'TAMIL'))
    SQL> insert into table(select books from my_tabnst where slno=1) values(3,'BENGALI');
    1 row created.
    SQL> select name from table(select books from my_tabNST where slno=1);
    NAME
    ENGLISH
    HINDI
    BENGALI
    *****************************Khaleel*******************

  • Including additional where clause conditions to view criteria dynamically

    Hi,
    We have a set of view objects that serves as LOV for various other view objects. All such LOV view objects have three specific attributes, two date attributes namely EffectiveStartDate, EffectiveEndDate and a String attribute namely UserSwitch based on which the LOV list needs to be filtered.
    All the view objects are having one or more view criterias with specific where clause conditions.
    Apart from those view criteria conditions, invariantly, we need the following conditions also
    :bindEffDate between EffectiveStartDate and EffectiveEndDate and UserSwitch = :bindUserSwitch.
    We wish not to include the above condition in each and every view criteria of each and every view object (Since we have around 800 view objects and a minimum of 2 view criterias per view object). Instead, we created a dummy view object (BaseViewObject) with two bind variables :bindEffDate and :bindUserSwitch and all the LOV view objects were made to extend this BaseViewObject.
    Therefore, whenever a view object atribute is attached with LOV using the above said LOV View Objects, the bind variables of the baseViewObject as well as the view object specific bind variables are available in the view accessors tab of the view object wizard where we can supply values to those bind variables.
    Now, we need to construct the view criteria filter clause. To achieve this, we created a class, CustomCriteriaAdapter.java extending oracle.jbo.server.CriteriaAdapterImpl. In the getCriteriaClause() method, we included the follwoing code:
    public String getCriteriaClause(ViewCriteria pViewCriteria)
    ViewObject vo = pViewCriteria.getViewObject();
    String userSelectSwitch = (String) vo.ensureVariableManager().getVariableValue("bindUserSwitch");
    String effBgnDt = vo.getAttributeDef(vo.getAttributeIndexOf("EffectiveStartDate")).getName();
    String effEndDt = vo.getAttributeDef(vo.getAttributeIndexOf("EffectiveEndDate")).getName();
    String customCriteria = " ( :bindEffDate >= " + effBgnDt + " ) AND ( :bindEffDate <= " + effEndDt + " OR " + effEndDt + " IS NULL ) ";
    StringBuffer completeCriteria = new StringBuffer();
    String criteriaClause = super.getCriteriaClause(pViewCriteria);
    if (criteriaClause != null && !criteriaClause.isEmpty())
    completeCriteria.append(criteriaClause + " AND ");
    completeCriteria.append(customCriteria);
    if (userSelectSwitch != null && "Y".equals(userSelectSwitch))
    String userSelectSw = vo.getAttributeDef(vo.getAttributeIndexOf("UserSwitch")).getName();
    completeCriteria.append(" AND (" + userSelectSw + "='Y' ) ");
    return completeCriteria.toString();
    Issues:
    The LOV list is not filtering the records based on the constructed conditions. Instead it is listing either all of the records considering only the view criteria conditions applied at design time irrespective of the userswitch and effectivedate conditions or the list is empty.
    Here, my questions are,
    1. Am I in the correct approach? If not, guide me in a more proper approach to achieve the same requirement.
    2. If the way I am trying is correct, where things are going wrong and why the dynamic condition is not getting effected?
    Kindly help in sorting out the issue.
    Thanks in advance.

    Hi Jobinesh,
    Thanks for your response and yes, we have done exactly as what you have mentioned. As explained earlier, a baseViewObject along with its Impl class has been created and it will be extended by all the viewobjects meant for serving LOV. Therefore, the superClass for any such LOV viewObject is the baseViewObjectImpl class. In that baseViewObjectImpl(), we have over-rided the criteriaAdapter() method and returned an instance of our customCriteriaAdapter() class.
    Below is the code we are using in the baseViewObjectImpl():
    package model.base.vo;
    import oracle.jbo.CriteriaAdapter;
    import oracle.jbo.server.ViewObjectImpl;
    public class BaseViewObjectImpl
    extends ViewObjectImpl
    * This is the default constructor (do not remove).
    public BaseViewObjectImpl()
    * Over-rided method of ViewObjectImpl class of the framework.
    * Calls the customized criteria adapter so that the default where clauses are added to the view criteria.
    * @return CriteriaAdapter.
    @Override
    public CriteriaAdapter getCriteriaAdapter()
    return new CustomCriteriaAdapter();
    I'll create a sample in HR schema and share with you shortly.
    Thanks and regards.

  • How to change the view criteria at run time for af:query

    Hi,
    I've a usecase where I need to change the view criteria of the af:query at run time.
    Use case:
    =======
    1) Consider a check box (Show Emps Under Dept 10) in the query panel when user selects and clicks 'Search' button should show the employees under dept 10. If user searches without selecting the check box, the results should show all the employees in all the departments.
    2) I need to have a check box always in the query panel. Its mandatory.
    The way I implemented:
    ==============
    1) Created a transient variable 'Show Emps Under Dept 10' in the EmployeeVO and also created a bind variable bind_DeptNo.
    2) Create a view criteria 'AllEmployees' which has only the transient attribute as the view criteria item and whose value set to 'false' by default.
    3) Created another view criteria 'EmpUnderDept' which has 'DepartmentId' as the view criteria item and whose value set to the bind variable 'bind_DeptNo'.
    4) Dropped the view criteria 'EmpUnderDept' as the 'af:query' panel in the jspx page.
    5) Overridden the queryListener as '#{EmpBean.empSearch}'
    6) Has the below code in the empSearch method as below. When user selects the check box, applying the other criteria 'EmpUnderDept' and setting the bind variable to '10'.
    public void empSearch(QueryEvent queryEvent) {
    // Add event code here...
    QueryDescriptor queryDesc = (QueryDescriptor) queryEvent.getDescriptor();
    ConjunctionCriterion conCrit = queryDesc.getConjunctionCriterion();
    List<Criterion> criterionList = conCrit.getCriterionList();
    List criterionValues = new ArrayList();
    Object criteriaValue = null;
    int criteriaNo = 0;
    DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    FacesContext facesContext = FacesContext.getCurrentInstance();
    for (Criterion criterion : criterionList) {
    AttributeDescriptor attrDescriptor = ((AttributeCriterion)criterion).getAttribute();
    System.out.println("============== attrDescriptor.getName() =================== " + attrDescriptor.getName());
    criteriaValue = ((AttributeCriterion)criterion).getValues().get(0);
    if(criteriaNo==0) {
    Boolean val = (Boolean) ((AttributeCriterion)criterion).getValues().get(0);
    if (val.equals(true)) {
    OperationBinding method = (OperationBinding) ADFUtil.findOperation("ExecuteWithParams");
    if(method!=null) {
    Map params = method.getParamsMap();
    //params.put(key, value)
    method.getParamsMap().put("bind_DeptId", 10L);
    method.execute();
    ADFUtil.invokeMethodExpression( "#{bindings.EmpUnderDeptCriteiaQuery.processQuery}", queryEvent);
    } else {
    //ADFUtil.invokeEL("#{bindings.ExecuteWithParams.execute}");
    ADFUtil.invokeMethodExpression( "#{bindings.AllEmployeesCriteriaQuery.processQuery}", queryEvent);
    But this approach is not working and its always showing all the employees in all the departments.
    Please let me know if there is a way to change the view criteria at run time depending on the values set at run time for one of the view criteria items.
    JDev version am using is '11.1.1.5'
    Thanks,
    Lakshman

    Hi Shay,
    It worked for me without overriding the executeQuery() method in the ViewImpl.java.
    Instead of creating 2 view criteria, I created only one which has both transient variable and the DepartmentId = <bind_DeptId>. With the above code, it worked properly. Now I am using only one view criteria.
    Thank you.

  • LOV view criteria missing in af:query field when AM pooling is disabled

    Hi all,
    Again, another strange behaviour with fields in af:query when AM pooling is disabled.
    I have a field with a LOV in the af:query area. This LOV has a view criteria that involves a bind variable. In the VO, the view accessor for this LOV applies the view criteria and sets the bind variable. When AM pooling is disabled, double clicking a row or clicking the OK button in the LOV window removes the where clause defined by the view criteria. When activation occurs, the bind variable still exists but the framework doesn't know where to apply it...
    Any help will be very appreciated,
    Thanks
    JDeveloper 11.1.1.3.0 with ADF BC
    We've just realised that this behaviour occurs even when pooling is enabled. So this is becoming now a serious problem.
    The scenario is as following: We have two LOVs in the search area (af:query). One of them is dependent on the other. Then, this second LOV has a view criteria and a bind variable representing the value selected for the first LOV. The query for the second LOV is filtered properly, but once a value has been selected and the LOV window dismissed, nothing is returned to the field.
    We have observed that SecondLovViewImpl.executeQueryForCollection() method executes twice:
    1. When LOV is opened: here, the bind variable is correctly setted.
    2. When a row in the LOV table is selected: here, the bind variable is reset to null.
    The log says (in Spanish):
    <OracleSQLBuilderImpl><bindParamValue> [46062] Binding null of type 12 for "bindProgram"
    <FacesCtrlLOVBinding$ListOfValuesModelImpl><_getRowFromSelectedRowKey> ADFv: No se ha encontrado ninguna fila para rowKey: [oracle.jbo.Key[P1 SP11 ]].
    I would be very grateful if somebody asked me... even for saying "this is nonsense", "this is a known bug", "cascading LOVs are not supported by af:query", or anything else... If a code snippet is required, I'll put it as well.
    Thanks in advance
    Edited by: Marge on 02-sep-2010 5:41

    Hi,
    there are two bugs associated with bind variables in successors that I am aware of. One of them is supposed to be fixed in the next patch set, another one is still open. However, both problems were found with AM pooling enabled as well, so I don't know this is the same problem (though it sounds like). If you can, I suggest to create a reproducible testcase on one of the Oracle database schema, like HR or OE, and file a bug. If you don't have a time for or access to support, send the test case in a zip file (rename ".zip" to ".unzip") to the mail Id you find in my OTN profile. However, be aware that when I file the bug then it wont be visible for you, nor can it be escalated on your behalf. Anyway, at least it would get filed
    Frank

Maybe you are looking for

  • How to tranport the users from SAP R/3 to portal ?

    Hi All, I had connected to SAP R/3  system from portal. I am trying to tranport the users from SAP development server . So that everyuser can enter through the portal only and work on SAP. Please guide me the procudure how can  i tranport the users f

  • Name of Offsetting Account Error in KSB1

    Hello When I ran KSB1, I noticed that the "name of the offsetting account" lists some names incorrectly. I ran KSB1 using the parameters of Personnel number so therefore the value in the "name of the offsetting account" should always be the vendor na

  • Status 51 error for inbound idoc

    Dear All, the error is sales order type 'OR' is blocked. I want to use Order type "ZD10" how can i change it. Please help me. Thanks in advance

  • Does Canon Digital Photo Professional work in Retina display?

    The photos look blurr compared to viewing them in iPhoto. I guess this is because it is displaying the images in the simulated 1440 x 900 resolution instead of the MBP Retina 15" 2880 x 1800 native resolution. Can it be forced to render in that mode

  • Time and date clock for web site

    hi all I am very new and mean very new I am building my first wed page and I am looking for a date/time clock thing to add to the site So the question has any one got one I can use or how do you write th tag for it Cheers Det