Two Queries, One View Object

I have two fairly different ways to query the same table.
One is a Spatial query, which returns rows that are within a radius of a starting point. This has the distance from the starting point as one of the expressions in the select list. You cannot have this expression in the select list unless the WHERE clause includes the spatial condition.
The other way to query the table is with more "normal" WHERE clauses, like "WHERE name LIKE '%'||:nameParm||'%'", probably created as ViewCriteria. Distance is meaningless for this sort of query.
Version one of the application solved this by having a single VO, and methods that reset the query as needed. But this had passivation/activation problems - when activated, the query would reset to the original query, but there might be bind variables left over from the other query. Solved it by not changing the query until just before it was executed. I'm not happy with this solution - it seems fragile to me.
I could have two View Objects each with one of the queries. I envision a user interface where the user can choose which way to query the table, and some logic would have to decide which bind variables to obtain and which VO to execute. But I'd like the results from either to appear in the same ADF Faces table component. The rest of the select list is the same and would have all the same labels, etc. in the UI. I don't mind if the VO for which Distance is meaningless has a Distance attribute that is always null - I would simply set that column to not display if not appropriate.
Possibilities: Subclass the two VOs from a third VO with a very basic version of the query, and use the parent VO in the ADF Faces table component? Or can I make the value attribute of the table dynamic - select the right VO at run time?

Okay... no answer to this one, so I kept working on my own answer.
Here's what I did:
I created a VO with a very basic query that has all WHERE criteria that are common to all queries. That includes three bind variables. Call this one "BaseVO".
I used TO_NUMBER(NULL) for the distance column that is only meaningful when you are doing a Spatial query.
I created all of my View Links to this VO. I also did all of my UI defaults against this VO.
Then I created two VO's that extend BaseVO. Each has the same attributes as the original, but one (call it NonSpatialVO) has View Criteria that encapsulate the non-spatial ways to query the table.
The other VO, SpatialVO, has a different query, but it has the same select list, so it still maps to the same attributes. It has a where clause for searching by latitude and longitude, so these are bind variables. And the spatial function for the distance from the starting point replaces TO_NUMBER(NULL) in the query.
So far, so good - the UI and View Links apply to NonSpatialVO and SpatialVO, even though they were only defined in BaseVO. It all works as expected when I run the Application Module.
Next step - on to using the VOs in some pages in the ViewController project.
It's going to have to decide dynamically which VO needs to be instantiated and executed, and then display the results in a table - the same table no matter which VO was used. I imagine that I'll use BaseVO to drag and drop the table on the page, but use EL to associated the correct VO with the "value" property.
If anyone has done something like this before - your comments and advice are welcome.

Similar Messages

  • Multi Model project but one view object

    Hi Gurus,
    I would like to fetch data from multiple database base tables and display them in one table. Is this possible to create multiple model project and have just one View object that is fed by
    model objects?
    Thanks,
    Jai.

    Hi Chris,
    I have multiple database/schemas, all the schemas have the same table, I want to display the table buit one of the field value (say creation date) differes in each of these schema tables.
    I want to display table information with the creation date(one for each schema) in a ADF table. I was wondering if we could converge multi-model in to one view object which has the creation_date1,2,3 (one for each
    model).
    Thanks,
    Jai.

  • Can reuse  one view object?

    Hi All,
    My server environment is JDeveloper 10.1.32 and JHeadstart 10.1.3.1.
    I use one view In two Dynamic Domain(A、B) of "Application Definition Editor/Domains".
    The Data Collection of Dynamic Domain(A、B) are using the same view object (v1).
    The v1 use a bind parameters , it's name is p_CodeType .
    a item choose A Domain.
    b item choose B Domain.
    a、b item's "Display Type" choose "DropDownList".
    A Domain has query bind parameters and it's value is p_CodeType=02 .
    B Domain has query bind parameters and it's value is p_CodeType=04 .
    Run,
    Two item's value of DropDownList are the same. a's DropDownList the same as b'DropDownList (p_CodeType=04).
    Can reuse one view on two different Domains?
    Thanks,
    syuan
    Message was edited by:
    user581971

    You can use the same ViewObject, but you need to create two separate view object usages in the application module for each domain.
    Steven Davelaar,
    JHeadstart Team.

  • Doing queries in view objects that do not include primary keys of entities

    Is it possible to create a view object based on an entity that doesn't include the primary key from that entity object. For instance I want to do something like "select distinct (attrib1) from sometable" and obviously attrib1 is not the primary key for that table so I get an error that says, you must include a primary key in your view object. How would I implement something like this in bc4j?

    You just need to go into expert mode and create the statement directly with the relevant SQL
    e.g. in 9.0.3:
    Context Menu -> New View Object
    Select no entities in Step 2
    Next through to Step 5 of the wizard and enter you expert mode SQL there. E.g. Select distinct deptno from emp
    Assign the new VO to the AM data model and away you go.

  • Joining these these two queries (one regular and one grouped)

    Hello
    I have these two queries I would like to join, however the later is a grouped query how can I join it with the first query?
    Has to be joined on EventId. The second query is a total table scan.
    SELECT AH.EventID,
    AH.TechnicalAddress, AH.AlarmAlias, AH.AlarmPath as [OrgAlarmPath], AH.AlarmCounter as AlarmCount, AH.EventDateTime as EventTime,
    AH.[Priority], AH.AlarmMessage, AH.EventText, AH.CallListName, AH.AlarmReadDate as EndTime,
    AH.alh_EventEndedUserRemark as [EndRemark] --, SUM(seconds) here, and AlarmSessions here
    FROM AlarmHistory AH
    WHERE (AH.HeartbeatAlarm = 0 OR AH.HeartbeatAlarm IS NULL) AND
    ((AH.CallListID IS NOT NULL) OR (AH.alh_IsForStatistics = 1)) AND
    (NOT (AH.alh_t_EventSubCode is NULL or AH.AlarmReadByUserID is NULL))
    ORDER BY AH.EventID DESC
    SELECT ia.eventID, SUM(DATEDIFF(SECOND,ia.eventTime,r.eventTime)) AS seconds, COUNT(*) as AlarmSessions
    FROM alarmHistoryLog ia
    INNER JOIN alarmHistoryLog r
    ON ia.EventId = r.EventId
    AND r.EventTypeId = 2
    AND r.EventSeq = (SELECT MIN(eventSeq) FROM alarmHistoryLog WHERE eventSeq > ia.EventSeq AND EventTypeId = 2)
    WHERE ia.EventTypeId = 0
    group by ia.EventId
    order by EventId desc
    Henry

    Try the below:
    ;with ctefirst as
    SELECT AH.EventID,
    AH.TechnicalAddress, AH.AlarmAlias, AH.AlarmPath as [OrgAlarmPath], AH.AlarmCounter as AlarmCount, AH.EventDateTime as EventTime,
    AH.[Priority], AH.AlarmMessage, AH.EventText, AH.CallListName, AH.AlarmReadDate as EndTime,
    AH.alh_EventEndedUserRemark as [EndRemark] --, SUM(seconds) here, and AlarmSessions here
    FROM AlarmHistory AH
    WHERE (AH.HeartbeatAlarm = 0 OR AH.HeartbeatAlarm IS NULL) AND
    ((AH.CallListID IS NOT NULL) OR (AH.alh_IsForStatistics = 1)) AND
    (NOT (AH.alh_t_EventSubCode is NULL or AH.AlarmReadByUserID is NULL))
    ), ctesecond as
    SELECT ia.eventID, SUM(DATEDIFF(SECOND,ia.eventTime,r.eventTime)) AS seconds, COUNT(*) as AlarmSessions
    FROM alarmHistoryLog ia
    INNER JOIN alarmHistoryLog r
    ON ia.EventId = r.EventId
    AND r.EventTypeId = 2
    AND r.EventSeq = (SELECT MIN(eventSeq)
    FROM alarmHistoryLog WHERE eventSeq > ia.EventSeq AND EventTypeId = 2)
    WHERE ia.EventTypeId = 0
    group by ia.EventId
    Select A.*,B.seconds,B.AlarmSessions From ctefirst A
    Inner join ctesecond B On A.EventId = B.EventID
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
     [Blog]

  • Two iterators - One view - Same page

    Hi, I have a big question...
    I have two iterator from the same view in one page, but when I re-execute the query from the view, it change both iterators. There's a way to make it without create a new viewObject for the second iterator?
    Here's my code:
    DCIteratorBinding iterator = (DCIteratorBinding)getBindings().get("iteratorOne");
    ViewObject voOne = iterator.getViewObject();
    voOne.setNamedWhereClauseParam("param", paramOne);
    voOne.executeQuery();
    DCIteratorBinding iterator = (DCIteratorBinding)getBindings().get("iteratorTwo");
    ViewObject voTwo = iterator.getViewObject();
    voTwo.setNamedWhereClauseParam("param", paramTwo);
    voTwo.executeQuery();
    Thanks

    This is my case of use, I have two combos of employes from the employeViewObject, but each combo is a diferent iterator from the same view, programmatic I pass a parameter (area) to the view and then I execute the query, but when I do it for one it make the change for the both combos, beacause it came from the same view.
    viewObject: EmpleadoSIRHPorAreaView
    iterator 1: EmpleadoSIRHPorAreaView1Iterator
    iterator 2: EmpleadoSIRHPorAreaView1Iterator1
    programmatc {
    DCIteratorBinding iterator = (DCIteratorBinding)getBindings().get("EmpleadoSIRHPorAreaView1Iterator");
    ViewObject empleadoVo = iterator.getViewObject();
    empleadoVo.setNamedWhereClauseParam("currentArea", valueChangeEvent.getNewValue());
    empleadoVo.executeQuery();
    Theres a way without make another view to execute the query just for one of them without affect the other iterator.
    Thanks

  • Uix two view-objects on one entity-object synchronize

    Hi All
    I want to add some uix pages to an old project using ADF UIX and Business Components.
    I have an entity object to a table witch about 50 fields.
    Now I create two view objects due to a better performance. One witch seven attributes for the overwiew and one with all attributes for the detail page.
    They are related via a view link.
    I create the overview as a read-only-table and the detail-page as an input-form.
    The proplem is that the synchronization don't work. The detail page shows the first dataset ever.
    Has anyone a solution or a tip where I can found that?
    Is where a performance problem if I use one view-object for both pages?
    Thanks in advance
    Roger

    Use custom DataAction for the first page:
    package controller;
    import oracle.adf.controller.struts.actions.DataAction;
    import oracle.adf.controller.struts.actions.DataActionContext;
    public class Class1 extends DataAction
      protected void validateModelUpdates(DataActionContext actionContext)
         //super.validateModelUpdates(actionContext);
          // put you custom validation here
    }http://www.oracle.com/technology/products/jdev/collateral/papers/10g/ADFBindingPrimer/index.html#usingdataaction
    Message was edited by:
    Sasha
    Message was edited by:
    Sasha

  • Web Application Designer - Concatenate two queries

    Hi All,
    we using BI 7.0 SAP GUI 6.40 Support Package 14.
    I created two Queries one with characteristics within hierarchy(1) and one for the result (2).
    I put the first one in filter pane item (1) and the analysis item for the second (2).
    If I executing the query I see a drop down menü for the first query (1) and the complete report on the second query(2).
    So, when I choose a characteristics from the drop down(2) there don`t changed the data at the second query(2) (result).
    How can I concatenate 2 Queries in Web Application Designer?
    Please give me a step-by-step solution.
    Thanks in advance.
    Regards, Wolfgang

    Basically you have one query in your dropdown box and when you select one from the dropdown box you want to affect the second query. If that is the objective, then you can do that only in one query, attach the field you need in the dropdown box and create view for the table (analysis Item) and attach the view to the item. Make sure in the first dropdown box, check on the affected area which is going to be the table (analysis Item).
    thanks.
    Wond

  • Creating View Object with different criteria

    Hi,
    I have a requirement to execute the following queries in the application logic. We have YEAR table with mileage rates with different effective dates. If the service date is greater than any of the existing effective dates we need to get the rate with that effective date. if the service date is less than the existing effective dates, then we have to get the rate with least effective date.
    SELECT mileage_rate, ... FROM year
    WHERE eff_date =  (SELECT MAX(eff_date) FROM   year WHERE  eff_date <= :bServiceDate)
    SELECT MILEAGE_RATE, .... FROM YEAR WHERE
    EFF_DATE =  (SELECT MIN(EFF_DATE) FROM YEAR)
    We have to execute the 1st query and if there is no matching records then we have to take the second query with min effective date. At present we are creating two view objects for the above scenario. Is there any possibility to create one view object with different criteria. What is the best solution to handle the above problem in ADF.
    Thanks and Regards,
    S R Prasad

    Well on the ViewObjectImpl you can fire the method getQueryHitCount() passing in the required ViewRowSetImpl. If you get the query hit count as 0, use can attached the other query and execute it.

  • ADF BC View Objects: Disappearing where clauses

    Playing around with the 11g Technical Preview I find out that sometimes the where clauses - added to View Objects by means of the new "Join Type" field in the VO-editor UI - disappear.
    I'm not able to reproduce exactly and "on demand", but it seems to happen when the sources of more than one View Object are open simultaneously and/or the XML definition of a View Object is edited directly on the Source-tab.

    Today I succeeded in reproducing:
    Two tables:
    TAB_MASTER:
    ID NUMBER NOT NULL
    DESCRIPTION VARCHAR2 NOT NULL
    TAB_DETAIL:
    ID NUMBER NOT NULL
    MASTER_ID NUMBER NOT NULL
    DESCRIPTION VARCHAR2 NOT NULL
    TAB_DETAIL.MASTER_ID is a foreign key referencing TAB_MASTER.ID.
    Steps to reproduce:
    1. Generate default ADF BC objects from database tables.
    2. Open definition of TAB_DETAIL View Object.
    3. Go to the Entity Objects tab
    4. Add TAB_MASTER Entity Object to the Selected Entities Objects. Association and Join Type are filled in automatically.
    5. Go to the Query tab and go to SQL tab in de Property Inspector. Where clause is filled.
    6. Go to the Attributes tab and click Add from Entity...
    7. Add TAB_MASTER.DESCRIPTION attribute.
    8. Again, go to the Query tab and go to SQL tab in de Property Inspector. Where clause is still filled.
    9. Go to the Attributes tab and select MASTER_ID attribute.
    10. Click icon to add List Of Values
    11. In List Of Values dialog add View Object TAB_MASTER and add the correct pairs of List Return Values for the ID and (MASTER) DESCRIPTION attributes.
    12. After completing the List Of Values dialog go to the Query tab -> SQL tab again. The where clause added to join the Entity Objects (see step 5.) is cleared, resulting in a wrong SQL statement for the View Object.

  • View object reexecutes when any event is fired on a page

    Hi All,
    I have following requirement
    Create a page which containts a table.
    Table has 2 fields one is Employee number LOV and second is emp name field which is read only.
    One view object is associated with this table.
    This view object has two transient attributes one is EmpId which is of type number and second is name which is of type string.
    View object does not have any query.
    when you enter any no in lov field,it goes to lov region and populates the respective emplyee details in the LOV region, when user selects any employee,it comes back to main page and shows Employee no and emp name in first row of a table.
    I have allowed the user to enter as many rows as he wants into the table.
    for that i have created Add another row button using footer property of table.
    but the problem is When i click Add another row button,row is added it to table but emp name which i have selected from LOV had lost.
    i know the reason is when i click Add another row button VO executes query again and my value has lost.
    i want to know that is there any way to prevent reexecution of view object query?
    Regards
    Hitesh

    Hitesh,
    Mukul, i can put my own Add another row button and do cusom code,but what about other events?
    Yes, see dev guide and old threads. It has been explained in dev guide claerly and have also replied this in old threads.--Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Connecting ADF BC view object w/ param to a JSF Table?

    I'm brand new to JDev so this is probably an easy one, I'm still trying to grasp some of the concepts: I have created an application module that has one view object containing a simple parameterized query (page is a simple search form - user enters keywords - I pass keywords to database and return results.) This Data Control shows up in the Data Control Palette and I am able to associate this with a table on the JSF page. Where I'm struggling is how / where do I tell JDev to bind the query parameter? In the examples from the help files, they show in the Data Control Palette a method with parameters. My Data Control Panel just shows the application module labeled as a Data Control with no parameters? In the Application Module (where I have defined the parameterized SQL stmt), in the Client Interface menu item, there are no methods available. Do I need to create the method even if I don't want to override the default functionality? Any help appreciated.
    Also, many of the tutorial and examples look like they use the EJB/Toplink approach - are there good examples or tutorial for using ADF BC and ADF Faces?
    Thanks. BTW - this product looks awesome so far! I was using myEclipse - this product is light years ahead.

    This new 10.1.3-production JSF/ADFBC tutorial covers a lot of ground and includes an example of building the search page that you're trying to build, too :-)
    http://otn.oracle.com/obe/obe1013jdev/masterdetail_adf_bc/master-detail_pagewith_adf_bc.htm
    The trick is noticing that a View Object with named bind parameters includes an additional built-in operation in its "Operations" folder called ExecuteWithParams. Dropping this operation onto your page gives you the choice of creating a "Parameter Form" for your VO's bind variables. If you then drop the VO as a readonly table to the same page and run the page, you are done. :-)
    Try to do that in Eclipse in two drag-drop operations! ;-)
    It warms my heart to hear you say that about JDeveloper versus Eclipse... Really makes my day!

  • Joining two queries causes big performance hit

    There are two queries: one with a sub query and one without
    although they both return the same data, one uses a full table scan of the indexed 'trade_index' table
    and thus is much slower
    any Ideas why it does this?:
    SQL> select count(*) from trade_index ti, counterparty_xref cx
    2 where ti.CPY_SID = cx.CPY_SID and ti.TRADE_OR_ARCHIVE = 'A'
    3 and cx.XREF_VALUE in (select ml.VALUE from v_mis_lists ml where ml.LIST_NAME = 'Deutsche Bank DB')
    4 and cx.XREF_TYPE = 'Client RXM'
    5 and ti.START_DATE < to_date('01/01/2004','DD/MM/YYYY')
    6 and (ti.END_DATE >= to_date('01/01/2003','DD/MM/YYYY') or ti.END_DATE = '01-Jan-1900') ;
    COUNT(*)
    6195
    Elapsed: 00:00:15.08
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2572 Card=1 Bytes=57)
    1 0 SORT (AGGREGATE)
    2 1 HASH JOIN (Cost=2572 Card=26581 Bytes=1515117)
    3 2 HASH JOIN (Cost=460 Card=5619 Bytes=219141)
    4 3 VIEW OF 'VW_NSO_1' (Cost=8 Card=16 Bytes=272)
    5 4 SORT (UNIQUE) (Cost=8 Card=16 Bytes=960)
    6 5 HASH JOIN (Cost=4 Card=16 Bytes=960)
    7 6 TABLE ACCESS (BY INDEX ROWID) OF 'MIS_LISTS' (Cost=1 Card=2 Bytes=60)
    8 7 INDEX (RANGE SCAN) OF 'MISL_NAT_UK' (UNIQUE) (Cost=2 Card=2)
    9 6 TABLE ACCESS (FULL) OF 'MIS_LIST_VALUES' (Cost=2 Card=817 Bytes=24510)
    10 3 TABLE ACCESS (FULL) OF 'COUNTERPARTY_XREF' (Cost=451 Card=35116 Bytes=772552)
    11 2 TABLE ACCESS (FULL) OF 'TRADE_INDEX' (Cost=2056 Card=286928 Bytes=5164704)
    SQL> select ml.VALUE from v_mis_lists ml where ml.LIST_NAME = 'Deutsche Bank DB';
    VALUE
    B49540
    B60010
    Elapsed: 00:00:00.00
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 NESTED LOOPS
    2 1 TABLE ACCESS (BY INDEX ROWID) OF 'MIS_LISTS'
    3 2 INDEX (RANGE SCAN) OF 'MISL_NAT_UK' (UNIQUE)
    4 1 INDEX (RANGE SCAN) OF 'MISLV_PK' (UNIQUE)
    SQL> select count(*) from trade_index ti, counterparty_xref cx
    2 where ti.CPY_SID = cx.CPY_SID and ti.TRADE_OR_ARCHIVE = 'A'
    3 and cx.XREF_VALUE in ('B49540','B60010')
    4 and cx.XREF_TYPE = 'Client RXM'
    5 and ti.START_DATE < to_date('01/01/2004','DD/MM/YYYY')
    6 and (ti.END_DATE >= to_date('01/01/2003','DD/MM/YYYY') or ti.END_DATE = '01-Jan-1900') ;
    COUNT(*)
    6195
    Elapsed: 00:00:02.06
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=532 Card=1 Bytes=40)
    1 0 SORT (AGGREGATE)
    2 1 NESTED LOOPS (Cost=532 Card=41 Bytes=1640)
    3 2 TABLE ACCESS (FULL) OF 'COUNTERPARTY_XREF' (Cost=451 Card=1 Bytes=22)
    4 2 TABLE ACCESS (BY INDEX ROWID) OF 'TRADE_INDEX' (Cost=81 Card=286928 Bytes=5164704)
    5 4 INDEX (RANGE SCAN) OF 'CPY_SID_IDX' (NON-UNIQUE) (Cost=2 Card=286928)
    What I dont understand is that:
    cx.XREF_VALUE in (select ml.VALUE from v_mis_lists ml where ml.LIST_NAME = 'Deutsche Bank DB')
    and
    cx.XREF_VALUE in ('B49540','B60010')
    are essentially the same thing
    (ie the subquery returns the values I have used)
    but the optimizer uses a totally different (slower) method to execute the rest of the former query?
    Many thanks
    Ian

    Hi,
    Here is with join and not using the view: still have full table scan of large table trade_index
    SQL> select count(*) from mis_lists ml, mis_list_values mlv, counterparty_xref cx, trade_index ti
    2 where ti.CPY_SID = cx.CPY_SID and ti.TRADE_OR_ARCHIVE = 'A'
    3 and cx.XREF_VALUE = mlv.VALUE
    4 and mlv.MISL_SID = ml.MISL_SID
    5 and ml.LIST_NAME = 'Deutsche Bank DB'
    6 and cx.XREF_TYPE = 'Client RXM'
    7 and ti.START_DATE < to_date('01/01/2004','DD/MM/YYYY')
    8 and (ti.END_DATE >= to_date('01/01/2003','DD/MM/YYYY') or ti.END_DATE = '01-Jan-1900') ;
    COUNT(*)
    6195
    Elapsed: 00:00:12.08
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2602 Card=1 Bytes=10
    0)
    1 0 SORT (AGGREGATE)
    2 1 HASH JOIN (Cost=2602 Card=26581 Bytes=2658100)
    3 2 HASH JOIN (Cost=456 Card=5619 Bytes=460758)
    4 3 HASH JOIN (Cost=4 Card=16 Bytes=960)
    5 4 TABLE ACCESS (BY INDEX ROWID) OF 'MIS_LISTS' (Cost1 Card=2 Bytes=60)
    6 5 INDEX (RANGE SCAN) OF 'MISL_NAT_UK' (UNIQUE) (Cost=2 Card=2)
    7 4 TABLE ACCESS (FULL) OF 'MIS_LIST_VALUES' (Cost=2 Card=817 Bytes=24510)
    8 3 TABLE ACCESS (FULL) OF 'COUNTERPARTY_XREF' (Cost=451Card=35116 Bytes=772552)
    9 2 TABLE ACCESS (FULL) OF 'TRADE_INDEX' (Cost=2056 Card=286928 Bytes=5164704)
    Statistics
    0 recursive calls
    47 db block gets
    16519 consistent gets
    4981 physical reads
    0 redo size
    205 bytes sent via SQL*Net to client
    622 bytes received via SQL*Net from client
    3 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    Thanks for you help,
    Ian

  • ADF BC: range paging on dynamic view object

    hi!
    i have a dynamically generated sql query and i want to get the results one page at a time. for this to work i create at runtime a view object and try to use range paging:
    String sql = "SELECT ...";
    ViewObject vo = appModule.createViewObjectFromQueryStmt("tmpVO"+System.currentTimeMillis(), sql);
    vo.setRangeSize(pageSize);
    vo.setAccessMode(RowSet.RANGE_PAGING);
    vo.scrollToRangePage(pageNo);
    vo.getEstimatedRowCount();
    Row[] rows = vo.getAllRowsInRange();
    vo.remove();
    but when i run this it was pretty slow. so i traced the database session and saw that the executed query was the sql string, not the range paging select (SELECT * FROM (SELECT /*+ FIRST_ROWS */ IQ.*, ROWNUM AS Z_R_N FROM (...).
    i use range paging on other view objects that are not dynamically generated and it works fine. please tell me what can i do to get only the specified page from the data base.
    thank you
    Edited:
    here is the select i run:
    SELECT UnitEO.UNIT_TYPE, UnitEO.UNIT_NR,
    UnitTypeEO.USER_UNIT_TYPE,
    UnitEO.UNIT_NR UNIT_NUMBER,
    UnitEO.NUMBER_PLATE_ID,
    AreaEO.AREA_NAME,
    UnitEO.SERIAL_NR
    FROM NW_UNIT UnitEO,
    NW_UNIT_DETAILS NwUnitDetailsEO,
    NW_UNIT_TYPE UnitTypeEO,
    NW_AREA AreaEO,
    NW_COMMUNICATION_COMPUTER ComputerEO
    WHERE
    UnitEO.deleted IS NULL
    AND UnitEO.UNIT_NR = NwUnitDetailsEO.UNIT_NR (+)
    AND UnitEO.UNIT_TYPE = NwUnitDetailsEO.UNIT_TYPE (+)
    AND UnitEO.UNIT_TYPE = UnitTypeEO.UNIT_TYPE
    AND UnitEO.AREA_ID = AreaEO.AREA_ID (+)
    AND UnitEO.COMPUTER_ID = ComputerEO.COMPUTER_ID (+)
    here is the jbo.debugoutput that was generated; it includes the creation of the app module, the execution of SearchEntityPkVO (a predefined vo, not paged), then the execution of the code above:
    08/07/22 13:56:52 [436] Connected to Oracle JBO Server - Version: 10.1.3.36.73
    08/07/22 13:56:52 [437] mPCollUsePMgr is false
    08/07/22 13:56:52 [438] ViewObjectImpl.mDefaultMaxRowsPerNode is 70
    08/07/22 13:56:52 [439] ViewObjectImpl.mDefaultMaxActiveNodes is 30
    08/07/22 13:56:52 [440] Created root application module: 'enermet.aim.search.model.SearchAppModule'
    08/07/22 13:56:52 [441] Locale is: 'en_US'
    08/07/22 13:56:52 [442] ApplicationPoolImpl.resourceStateChanged wasn't release related. No notify invoked.
    08/07/22 13:56:52 [443] Oracle SQLBuilder: Registered driver: oracle.jdbc.driver.OracleDriver
    08/07/22 13:56:52 [444] Creating a new pool resource
    08/07/22 13:56:52 [445] Trying connection/2: url='jdbc:oracle:thin:@AIMTEST:1521:AIM' ...
    08/07/22 13:56:53 [446] Successfully logged in
    08/07/22 13:56:53 [447] JDBCDriverVersion: 10.1.0.5.0
    08/07/22 13:56:53 [448] DatabaseProductName: Oracle
    08/07/22 13:56:53 [449] DatabaseProductVersion: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production With the Partitioning, OLAP and Data Mining options
    08/07/22 13:56:53 [450] <AM MomVer="0">
    <cd/>
    <CONN/>
    </AM>
    08/07/22 14:00:21 [985] SearchEntityPkVO>#q old SQLStmtBufLen: 234, actual=163, storing=223
    08/07/22 14:00:21 [986] select sep.pk_name, sep.position
    from MD_SEARCH_ENTITY_PK sep
    inner join MD_SEARCH_ENTITIES se
    on se.entity_id = sep.entity_id
    where se.name = :VarEntityName
    08/07/22 14:00:21 [987] ViewObject: SearchEntityPkVO Estimated Row Count Query Statement:
    08/07/22 14:00:21 [988] "SELECT count(1) FROM (select sep.pk_name, sep.position
    from MD_SEARCH_ENTITY_PK sep
    inner join MD_SEARCH_ENTITIES se
    on se.entity_id = sep.entity_id
    where se.name = :VarEntityName) "
    08/07/22 14:00:21 [989] Bind params for ViewObject.getQueryHitCount: SearchEntityPkVO
    08/07/22 14:00:21 [990] Binding param "VarEntityName": Unit
    08/07/22 14:00:21 [991] ViewObject: SearchEntityPkVO Estimated Row Count: 2
    08/07/22 14:00:21 [992] Clear QueryCollection in cache for VO tmpVO1216724421562
    08/07/22 14:00:21 [993] ViewObject: tmpVO1216724421562 close prepared statements...
    08/07/22 14:00:21 [994] tmpVO1216724421562>#q computed SQLStmtBufLen: 641, actual=601, storing=631
    08/07/22 14:00:21 [995] SELECT UnitEO.UNIT_TYPE, UnitEO.UNIT_NR,
    UnitTypeEO.USER_UNIT_TYPE,
    UnitEO.UNIT_NR UNIT_NUMBER,
    UnitEO.NUMBER_PLATE_ID,
    AreaEO.AREA_NAME,
    UnitEO.SERIAL_NR
    FROM NW_UNIT UnitEO,
    NW_UNIT_DETAILS NwUnitDetailsEO,
    NW_UNIT_TYPE UnitTypeEO,
    NW_AREA AreaEO,
    NW_COMMUNICATION_COMPUTER ComputerEO
    WHERE
    UnitEO.deleted IS NULL
    AND UnitEO.UNIT_NR = NwUnitDetailsEO.UNIT_NR (+)
    AND UnitEO.UNIT_TYPE = NwUnitDetailsEO.UNIT_TYPE (+)
    AND UnitEO.UNIT_TYPE = UnitTypeEO.UNIT_TYPE
    AND UnitEO.AREA_ID = AreaEO.AREA_ID (+)
    AND UnitEO.COMPUTER_ID = ComputerEO.COMPUTER_ID (+)
    08/07/22 14:00:21 [996] *** createViewAttributeDefImpls: oracle.jdbc.driver.T4CPreparedStatement@4e6
    08/07/22 14:00:21 [997] Bind params for ViewObject: tmpVO1216724421562
    08/07/22 14:00:21 [998] Clear QueryCollection in cache for VO tmpVO1216724421562
    08/07/22 14:00:21 [999] ViewObject: tmpVO1216724421562 close prepared statements...
    08/07/22 14:00:21 [1000] Column count: 7
    08/07/22 14:00:21 [1001] tmpVO1216724421562>#q computed SQLStmtBufLen: 641, actual=601, storing=661
    08/07/22 14:00:21 [1002] SELECT UnitEO.UNIT_TYPE, UnitEO.UNIT_NR,
    UnitTypeEO.USER_UNIT_TYPE,
    UnitEO.UNIT_NR UNIT_NUMBER,
    UnitEO.NUMBER_PLATE_ID,
    AreaEO.AREA_NAME,
    UnitEO.SERIAL_NR
    FROM NW_UNIT UnitEO,
    NW_UNIT_DETAILS NwUnitDetailsEO,
    NW_UNIT_TYPE UnitTypeEO,
    NW_AREA AreaEO,
    NW_COMMUNICATION_COMPUTER ComputerEO
    WHERE
    UnitEO.deleted IS NULL
    AND UnitEO.UNIT_NR = NwUnitDetailsEO.UNIT_NR (+)
    AND UnitEO.UNIT_TYPE = NwUnitDetailsEO.UNIT_TYPE (+)
    AND UnitEO.UNIT_TYPE = UnitTypeEO.UNIT_TYPE
    AND UnitEO.AREA_ID = AreaEO.AREA_ID (+)
    AND UnitEO.COMPUTER_ID = ComputerEO.COMPUTER_ID (+)
    08/07/22 14:00:21 [1003] ViewObject: tmpVO1216724421562 Estimated Row Count Query Statement:
    08/07/22 14:00:21 [1004] "SELECT count(1) FROM (SELECT UnitEO.UNIT_TYPE, UnitEO.UNIT_NR,
    UnitTypeEO.USER_UNIT_TYPE,
    UnitEO.UNIT_NR UNIT_NUMBER,
    UnitEO.NUMBER_PLATE_ID,
    AreaEO.AREA_NAME,
    UnitEO.SERIAL_NR
    FROM NW_UNIT UnitEO,
    NW_UNIT_DETAILS NwUnitDetailsEO,
    NW_UNIT_TYPE UnitTypeEO,
    NW_AREA AreaEO,
    NW_COMMUNICATION_COMPUTER ComputerEO
    WHERE
    UnitEO.deleted IS NULL
    AND UnitEO.UNIT_NR = NwUnitDetailsEO.UNIT_NR (+)
    AND UnitEO.UNIT_TYPE = NwUnitDetailsEO.UNIT_TYPE (+)
    AND UnitEO.UNIT_TYPE = UnitTypeEO.UNIT_TYPE
    AND UnitEO.AREA_ID = AreaEO.AREA_ID (+)
    AND UnitEO.COMPUTER_ID = ComputerEO.COMPUTER_ID (+)
    08/07/22 14:00:21 [1005] Bind params for ViewObject.getQueryHitCount: tmpVO1216724421562
    08/07/22 14:00:26 [1006] ViewObject: tmpVO1216724421562 Estimated Row Count: 32732
    08/07/22 14:00:26 [1007] Column count: 7
    08/07/22 14:00:26 [1008] ViewObject: tmpVO1216724421562 Created new QUERY statement
    08/07/22 14:00:26 [1009] tmpVO1216724421562>#q old SQLStmtBufLen: 661, actual=601, storing=631
    08/07/22 14:00:26 [1010] SELECT * FROM (SELECT /*+ FIRST_ROWS */ IQ.*, ROWNUM AS Z_R_N FROM (SELECT UnitEO.UNIT_TYPE, UnitEO.UNIT_NR,
    UnitTypeEO.USER_UNIT_TYPE,
    UnitEO.UNIT_NR UNIT_NUMBER,
    UnitEO.NUMBER_PLATE_ID,
    AreaEO.AREA_NAME,
    UnitEO.SERIAL_NR
    FROM NW_UNIT UnitEO,
    NW_UNIT_DETAILS NwUnitDetailsEO,
    NW_UNIT_TYPE UnitTypeEO,
    NW_AREA AreaEO,
    NW_COMMUNICATION_COMPUTER ComputerEO
    WHERE
    UnitEO.deleted IS NULL
    AND UnitEO.UNIT_NR = NwUnitDetailsEO.UNIT_NR (+)
    AND UnitEO.UNIT_TYPE = NwUnitDetailsEO.UNIT_TYPE (+)
    AND UnitEO.UNIT_TYPE = UnitTypeEO.UNIT_TYPE
    AND UnitEO.AREA_ID = AreaEO.AREA_ID (+)
    AND UnitEO.COMPUTER_ID = ComputerEO.COMPUTER_ID (+)
    ) IQ WHERE ROWNUM < :0) WHERE Z_R_N > :1
    08/07/22 14:00:26 [1011] Bind params for ViewObject: tmpVO1216724421562
    08/07/22 14:00:26 [1012] setting rownum query between (0, 23)
    08/07/22 14:00:26 [1013] ViewObject: tmpVO1216724421562 close prepared statements...
    PS: I am using JDev 10.1.3.36.73

    You have a couple of choices. You could create one view object with a bind variable parameter(s) and in the application module you have 10 instances of that VO with appropriate values set for the bind variable in each instance.
    Or if you are using the LOV feature of a VO then you can set an attribute to point to one VO and then using a view cirteria applied to that specific LOV you can then "filter" the data that would appear in that LOV.
    Does that help?
    Grant Ronald

  • Custom Search using new View Object (Programatically)

    Hi Experts,
    Currently i am exploring the ADF-BC and i have a basic question. Hope you experts will help on this. I am thinking of implementing the search functionality with out using the "Query component" because the search that i am going to implement is complex and very custom. So for that i have decided to create one View object with the controls that needs to be displayed in the search screen. E.g assume the DepartmentVO is available and i want to create the search screen So i have create a another view object called DepartmentSearchVO (Program view object) and create transient variables for each search filed that i was thinking to have.
    Now i want to implement the Search button. When the users clicks on the search then i can called the DepartmentVORowImpl method called search() and construct the query based on the input. Then how about the results return. Since the DeparmentVO is coarse grain i am thinking to have another light View object called DeparmentLightVO (Program object) and use that to bind with the table for display.
    Please let me know am i going in the right direction. Is there any better way for this kind of requirement implementation.
    -t

    Hi,
    As Shay mentioned, you could set the where clause of the VO which you want to filter.
    In your search() method, you could get the VO (DeparmentVO in your case), set the where clause based on the parameters you are passing to this method (or the columns in the DepartmentSearchVO) and execute the query.
    You could use the VO (on which you've performed executeQuery) as a table / ROT in your application.
    -Arun

Maybe you are looking for

  • Adapter and/or converter

    for all apple products that have that big white block (used to charge the product), i know its an adapter, but is it a converter? i read somewhere that someone went to a different country and tried to charge their computer and burned out their logic

  • Slovakian Language (SK) character display problem

    Hi, Enviroment:R3 enterprise 110 /unicode/Oracle I'm having problem with one of the character for Slovakian. It seems that the character are display correctly when displaying thru Customer master data display (FD03 ) but show garble character (# etc)

  • Audit enqueue and dequeue

    Hi, Could anyone help me how audit enqueue or dequeue? I've tried the follows statement, but it didn't work: audit DEQUEUE ANY QUEUE by access; audit ENQUEUE ANY QUEUE by access;

  • Error message after burning

    I keep getting an error message after I burn a song to CD, telling me it failed when it, in fact worked.  I have the latest iTunes software installed. 

  • Can I use a later version of photoshop with DW cs4?

    Hi, I have Dreamweaver CS4, and I need to get photoshop to use with it. Do I need to get Photoshop CS4 or would CS5 work OK? Thanks, Hazel.