ViewObject: pagination

Hello All,
I am trying to implement pagination through Viewobject such that it load only x number of rows from DB, i read about range paging in oracle docs and i am trying to implement the same but i am not able to do so:
    MyROVOImpl vo = getMyROVO();
    vo.setRangeSize(argPageSize);
    vo.setAccessMode(RowSet.RANGE_PAGING);
    while (vo.hasNext())
      System.out.println(vo.next());
    }my while loop is executed hundreds of times ie. loading all the rows...
Please help me find out how it can be done.. i will appreciate your help..
Thanks

Hi,
I have some dirty way to do it, i am not sure if this is something you want though... As per my understanding i can offer you something like below:
    int rangeStart = (pageNo * rangeSize) - rangeSize;
    int rangeEnd = (pageNo * rangeSize) + 1;
    YourROVOImpl vo = getYourROVOImpl();
    vo.setFullSqlMode(YourROVOImpl.FULLSQL_MODE_AUGMENTATION);
    vo.setQuery("select * from (" +
                "SELECT IQ.*, ROWNUM as Z_R_N from ( " +
                " SELECT * FROM your_table where someCondition_if_u_have_one" +
                " )IQ WHERE ROWNUM &lt " + rangeEnd + " ) " +
                " WHERE Z_R_N &gt " + rangeStart);
     vo.executeQuery();     This will take care of rangeSize and paging both as they changes on each request.
I would also say try to use bind variable instead of injecting variable in the query, just for sql injection case.
Let me know, if it was what you wanted.
Thanks
Raj

Similar Messages

  • Pagination after executequery with a dynamic where clause

    Hi all,
    I have a problem with pagination after setting a where clause dynamically and performing an executequery in ViewObjectImpl.java.
    As a result of this, the amount of records are decreased returned by the viewobject, however the pagination is not changed. It still reflects the previous amount. It changes only if you have selected the last range of the changed recordset
    Does anybody know how to get the pagination to refect the correct amount of the updated recordset of the viewobject?
    Jdeveloper version 10.1.3.4 / Jheadstart 10.1.3.3.81
    Thanks in advance, Erwin

    Hi,
    I would not add this to the VO query. Instead I would create a View Criteria that uses a bind variable. Then in the Application Module Data Model, you select the VO instance and choose edit (button on top) to permanently associate the view criteria)
    Advantages of this approach
    - The VO definition can be used elsewhere without the restriction
    - the bind variable is not mandatory and yu can set it such that if no value is provided a full query is executed
    Frank

  • Table sorting with pagination

    Hi,
    I have implemented pagination for the table. I have start,previous,next,last buttons in the bottom of the table. It is working fine.
    Generally if i click on column for sorting it will sort the columns in which where we are.(Suppose if we are in second page, it will sort the rows only in 2nd page as i am using range paging for VO.)
    But,instead of sorting rows on the specific page client is asking me to do the sorting on all rows in the table and display it accordingly.
    Here i m not able to sort the rows in the sort listener.
    Let me explain u with example.
    I have 2 columns in the table name,age. and displaying 5 rows per page. and rows are like A,B,C,D,E in first page and F,G,H,I,J,K are in 2 nd page..
    Name| Age
    A
    B
    C
    D
    E
    now if i click on column Name for sorting for desc it gives E,D,C,B,A ,for ASc it gives A,B,C,D,E ...
    But for me if i click on desc the rows should be in the order of K,J,I,H,G,F..
    After ascending
    Name| Age
    A
    B
    C
    D
    E
    After descending
    Name| Age
    K
    J
    I
    H
    G
    F
    Here is the my code for pagination on click of pagination buttons : Just am setting scroll range for the VO terator..
    JUCtrlRangeBinding staffView = getStaffView();
    int prePage =staffView.getIteratorBinding().getNavigatableRowIterator().getRangeStart() / RANGE_SIZE + 1;
    ViewObject vo = staffView.getIteratorBinding().getViewObject();
    vo.setAccessMode(vo.RANGE_PAGING);
    staffView.getIteratorBinding().getNavigatableRowIterator().scrollRange(RANGE_SIZE * (this.pageNumber -prePage));
    any idea about how to implement sort accordingly for table?
    Hope you understand ,you problem..Let me know if any questions..
    Thanks..

    let me give it a hit: Can you try setting the query execution mode to database just before you start sorting ?
    http://docs.oracle.com/cd/E16764_01/apirefs.1111/e10653/oracle/jbo/ViewObject.html , check for QUERY_MODE_SCAN_DATABASE_TABLES
    Edited by: Kamaal, Saif Kamaal on Dec 19, 2012 6:34 PM

  • Issue in pagination of pivotal view (10 rows per page)???

    Hi All,
    I’m implementing pagination in pivotal view, report has to show 10 records per page.
    Report has to show for 8 weeks data per employee and 10 employees information per page, however report is displaying data for more than 10 employees and for a week single week, in second page its showing for 2 week and so on ….
    I used all the following functions however issue persists.
    1. FLOOR(RCOUNT(1) /10)
    2. CEILING((RCOUNT(1))/10.0)
    3. TRUNCATE((RCOUNT(1)-1)/10, 0) +1
    4. CASE when rcount(1)<11 then '1-10' when rcount(1)<21 then '11-20' when rcount(1)<31 then '21-30' else '30+' end
    Any suggestions
    Thanks,
    SMA

    Look in criteria add one more column
    in FX write this formula
    Go to the formula window of this column and enter the formula shown below
    CASE WHEN RCOUNT(1) < 11 THEN ‘1-10′
    WHEN RCOUNT(1) < 21 THEN ‘11-20′
    WHEN RCOUNT(1) < 31 THEN ‘21-30′
    ELSE ‘30+’ END
    Once this is done, drag and drop this column into the Pages section of your pivot table. Now you can paginate through your pivot table report.
    let us know if its solve your problem
    Thanks

  • Pagination query help needed for large table - force a different index

    I'm using a slight modification of the pagination query from over at Ask Tom's: [http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html]
    Mine looks like this when fetching the first 100 rows of all members with last name Smith, ordered by join date:
    SELECT members.*
    FROM members,
        SELECT RID, rownum rnum
        FROM
            SELECT rowid as RID
            FROM members
            WHERE last_name = 'Smith'
            ORDER BY joindate
        WHERE rownum <= 100
    WHERE rnum >= 1
             and RID = members.rowidThe difference between this and the one at Ask Tom's is that my innermost query just returns the ROWID. Then in the outermost query we join the ROWIDs returned to the members table, after we have pruned the ROWIDs down to only the chunk of 100 we want. This makes it MUCH faster (verifiably) on our large tables, as it is able to use the index on the innermost query (well... read on).
    The problem I have is this:
    SELECT rowid as RID
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindateThis will use the index for the predicate column (last_name) instead of the unique index I have defined for the joindate column (joindate, sequence). (Verifiable with explain plan). It is much slower this way on a large table. So I can hint it using either of the following methods:
    SELECT /*+ index(members, joindate_idx) */ rowid as RID
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindate
    SELECT /*+ first_rows(100) */ rowid as RID
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindateEither way, it now uses the index of the ORDER BY column (joindate_idx), so now it is much faster as it does not have to do a sort (remember, VERY large table, millions of records). So that seems good. But now, on my outermost query, I join the rowid with the meaningful columns of data from the members table, as commented below:
    SELECT members.*      -- Select all data from members table
    FROM members,           -- members table added to FROM clause
        SELECT RID, rownum rnum
        FROM
            SELECT /*+ index(members, joindate_idx) */ rowid as RID   -- Hint is ignored now that I am joining in the outer query
            FROM members
            WHERE last_name = 'Smith'
            ORDER BY joindate
        WHERE rownum <= 100
    WHERE rnum >= 1
            and RID = members.rowid           -- Merge the members table on the rowid we pulled from the inner queriesOnce I do this join, it goes back to using the predicate index (last_name) and has to perform the sort once it finds all matching values (which can be a lot in this table, there is high cardinality on some columns).
    So my question is, in the full query above, is there any way I can get it to use the ORDER BY column for indexing to prevent it from having to do a sort? The join is what causes it to revert back to using the predicate index, even with hints. Remove the join and just return the ROWIDs for those 100 records and it flies, even on 10 million records.
    It'd be great if there was some generic hint that could accomplish this, such that if we change the table/columns/indexes, we don't need to change the hint (the FIRST_ROWS hint is a good example of this, while the INDEX hint is the opposite), but any help would be appreciated. I can provide explain plans for any of the above if needed.
    Thanks!

    Lakmal Rajapakse wrote:
    OK here is an example to illustrate the advantage:
    SQL> set autot traceonly
    SQL> select * from (
    2  select a.*, rownum x  from
    3  (
    4  select a.* from aoswf.events a
    5  order by EVENT_DATETIME
    6  ) a
    7  where rownum <= 1200
    8  )
    9  where x >= 1100
    10  /
    101 rows selected.
    Execution Plan
    Plan hash value: 3711662397
    | Id  | Operation                      | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |            |  1200 |   521K|   192   (0)| 00:00:03 |
    |*  1 |  VIEW                          |            |  1200 |   521K|   192   (0)| 00:00:03 |
    |*  2 |   COUNT STOPKEY                |            |       |       |            |          |
    |   3 |    VIEW                        |            |  1200 |   506K|   192   (0)| 00:00:03 |
    |   4 |     TABLE ACCESS BY INDEX ROWID| EVENTS     |   253M|    34G|   192   (0)| 00:00:03 |
    |   5 |      INDEX FULL SCAN           | EVEN_IDX02 |  1200 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter("X">=1100)
    2 - filter(ROWNUM<=1200)
    Statistics
    0  recursive calls
    0  db block gets
    443  consistent gets
    0  physical reads
    0  redo size
    25203  bytes sent via SQL*Net to client
    281  bytes received via SQL*Net from client
    8  SQL*Net roundtrips to/from client
    0  sorts (memory)
    0  sorts (disk)
    101  rows processed
    SQL>
    SQL>
    SQL> select * from aoswf.events a, (
    2  select rid, rownum x  from
    3  (
    4  select rowid rid from aoswf.events a
    5  order by EVENT_DATETIME
    6  ) a
    7  where rownum <= 1200
    8  ) b
    9  where x >= 1100
    10  and a.rowid = rid
    11  /
    101 rows selected.
    Execution Plan
    Plan hash value: 2308864810
    | Id  | Operation                   | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |            |  1200 |   201K|   261K  (1)| 00:52:21 |
    |   1 |  NESTED LOOPS               |            |  1200 |   201K|   261K  (1)| 00:52:21 |
    |*  2 |   VIEW                      |            |  1200 | 30000 |   260K  (1)| 00:52:06 |
    |*  3 |    COUNT STOPKEY            |            |       |       |            |          |
    |   4 |     VIEW                    |            |   253M|  2895M|   260K  (1)| 00:52:06 |
    |   5 |      INDEX FULL SCAN        | EVEN_IDX02 |   253M|  4826M|   260K  (1)| 00:52:06 |
    |   6 |   TABLE ACCESS BY USER ROWID| EVENTS     |     1 |   147 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter("X">=1100)
    3 - filter(ROWNUM<=1200)
    Statistics
    8  recursive calls
    0  db block gets
    117  consistent gets
    0  physical reads
    0  redo size
    27539  bytes sent via SQL*Net to client
    281  bytes received via SQL*Net from client
    8  SQL*Net roundtrips to/from client
    0  sorts (memory)
    0  sorts (disk)
    101  rows processed
    Lakmal (and OP),
    Not sure what advantage you are trying to show here. But considering that we are talking about pagination query here and order of records is important, your 2 queries will not always generate output in same order. Here is the test case:
    SQL> select * from v$version ;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      10.2.0.1
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      ALL_ROWS
    optimizer_secure_view_merging        boolean     TRUE
    SQL> show parameter pga
    NAME                                 TYPE        VALUE
    pga_aggregate_target                 big integer 103M
    SQL> create table t nologging as select * from all_objects where 1 = 2 ;
    Table created.
    SQL> create index t_idx on t(last_ddl_time) nologging ;
    Index created.
    SQL> insert /*+ APPEND */ into t (owner, object_name, object_id, created, last_ddl_time) select owner, object_name, object_id, created, sysdate - dbms_random.value(1, 100) from all_objects order by dbms_random.random;
    40617 rows created.
    SQL> commit ;
    Commit complete.
    SQL> exec dbms_stats.gather_table_stats(user, 'T', cascade=>true);
    PL/SQL procedure successfully completed.
    SQL> select object_id, object_name, created from t, (select rid, rownum rn from (select rowid rid from t order by created desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid ;
    OBJECT_ID OBJECT_NAME                    CREATED
         47686 ALL$OLAP2_JOIN_KEY_COLUMN_USES 28-JUL-2009 08:08:39
         47672 ALL$OLAP2_CUBE_DIM_USES        28-JUL-2009 08:08:39
         47681 ALL$OLAP2_CUBE_MEASURE_MAPS    28-JUL-2009 08:08:39
         47682 ALL$OLAP2_FACT_LEVEL_USES      28-JUL-2009 08:08:39
         47685 ALL$OLAP2_AGGREGATION_USES     28-JUL-2009 08:08:39
         47692 ALL$OLAP2_CATALOGS             28-JUL-2009 08:08:39
         47665 ALL$OLAPMR_FACTTBLKEYMAPS      28-JUL-2009 08:08:39
         47688 ALL$OLAP2_DIM_LEVEL_ATTR_MAPS  28-JUL-2009 08:08:39
         47689 ALL$OLAP2_DIM_LEVELS_KEYMAPS   28-JUL-2009 08:08:39
         47669 ALL$OLAP9I2_HIER_DIMENSIONS    28-JUL-2009 08:08:39
         47666 ALL$OLAP9I1_HIER_DIMENSIONS    28-JUL-2009 08:08:39
    11 rows selected.
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid ;
    OBJECT_ID OBJECT_NAME                    LAST_DDL_TIME
         11749 /b9fe5b99_OraRTStatementComman 06-FEB-2010 03:43:49
         13133 oracle/jdbc/driver/OracleLog$3 06-FEB-2010 03:45:44
         37534 com/sun/mail/smtp/SMTPMessage  06-FEB-2010 03:46:14
         36145 /4e492b6f_SerProfileToClassErr 06-FEB-2010 03:11:09
         26815 /7a628fb8_DefaultHSBChooserPan 06-FEB-2010 03:26:55
         16695 /2940a364_RepIdDelegator_1_3   06-FEB-2010 03:38:17
         36539 sun/io/ByteToCharMacHebrew     06-FEB-2010 03:28:57
         14044 /d29b81e1_OldHeaders           06-FEB-2010 03:12:12
         12920 /25f8f3a5_BasicSplitPaneUI     06-FEB-2010 03:11:06
         42266 SI_GETCLRHSTGRFTR              06-FEB-2010 03:40:20
         15752 /2f494dce_JDWPThreadReference  06-FEB-2010 03:09:31
    11 rows selected.
    SQL> select object_id, object_name, last_ddl_time from (select t1.*, rownum rn from (select * from t order by last_ddl_time desc) t1 where rownum <= 1200) where rn >= 1190 ;
    OBJECT_ID OBJECT_NAME                    LAST_DDL_TIME
         37534 com/sun/mail/smtp/SMTPMessage  06-FEB-2010 03:46:14
         13133 oracle/jdbc/driver/OracleLog$3 06-FEB-2010 03:45:44
         11749 /b9fe5b99_OraRTStatementComman 06-FEB-2010 03:43:49
         42266 SI_GETCLRHSTGRFTR              06-FEB-2010 03:40:20
         16695 /2940a364_RepIdDelegator_1_3   06-FEB-2010 03:38:17
         36539 sun/io/ByteToCharMacHebrew     06-FEB-2010 03:28:57
         26815 /7a628fb8_DefaultHSBChooserPan 06-FEB-2010 03:26:55
         14044 /d29b81e1_OldHeaders           06-FEB-2010 03:12:12
         36145 /4e492b6f_SerProfileToClassErr 06-FEB-2010 03:11:09
         12920 /25f8f3a5_BasicSplitPaneUI     06-FEB-2010 03:11:06
         15752 /2f494dce_JDWPThreadReference  06-FEB-2010 03:09:31
    11 rows selected.
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid order by last_ddl_time desc ;
    OBJECT_ID OBJECT_NAME                    LAST_DDL_TIME
         37534 com/sun/mail/smtp/SMTPMessage  06-FEB-2010 03:46:14
         13133 oracle/jdbc/driver/OracleLog$3 06-FEB-2010 03:45:44
         11749 /b9fe5b99_OraRTStatementComman 06-FEB-2010 03:43:49
         42266 SI_GETCLRHSTGRFTR              06-FEB-2010 03:40:20
         16695 /2940a364_RepIdDelegator_1_3   06-FEB-2010 03:38:17
         36539 sun/io/ByteToCharMacHebrew     06-FEB-2010 03:28:57
         26815 /7a628fb8_DefaultHSBChooserPan 06-FEB-2010 03:26:55
         14044 /d29b81e1_OldHeaders           06-FEB-2010 03:12:12
         36145 /4e492b6f_SerProfileToClassErr 06-FEB-2010 03:11:09
         12920 /25f8f3a5_BasicSplitPaneUI     06-FEB-2010 03:11:06
         15752 /2f494dce_JDWPThreadReference  06-FEB-2010 03:09:31
    11 rows selected.
    SQL> set autotrace traceonly
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid order by last_ddl_time desc
      2  ;
    11 rows selected.
    Execution Plan
    Plan hash value: 44968669
    | Id  | Operation                       | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                |       |  1200 | 91200 |   180   (2)| 00:00:03 |
    |   1 |  SORT ORDER BY                  |       |  1200 | 91200 |   180   (2)| 00:00:03 |
    |*  2 |   HASH JOIN                     |       |  1200 | 91200 |   179   (2)| 00:00:03 |
    |*  3 |    VIEW                         |       |  1200 | 30000 |    98   (0)| 00:00:02 |
    |*  4 |     COUNT STOPKEY               |       |       |       |            |          |
    |   5 |      VIEW                       |       | 40617 |   475K|    98   (0)| 00:00:02 |
    |   6 |       INDEX FULL SCAN DESCENDING| T_IDX | 40617 |   793K|    98   (0)| 00:00:02 |
    |   7 |    TABLE ACCESS FULL            | T     | 40617 |  2022K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("T".ROWID="T1"."RID")
       3 - filter("RN">=1190)
       4 - filter(ROWNUM<=1200)
    Statistics
              1  recursive calls
              0  db block gets
            348  consistent gets
              0  physical reads
              0  redo size
           1063  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             11  rows processed
    SQL> select object_id, object_name, last_ddl_time from (select t1.*, rownum rn from (select * from t order by last_ddl_time desc) t1 where rownum <= 1200) where rn >= 1190 ;
    11 rows selected.
    Execution Plan
    Plan hash value: 882605040
    | Id  | Operation                | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT         |      |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  1 |  VIEW                    |      |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  2 |   COUNT STOPKEY          |      |       |       |            |          |
    |   3 |    VIEW                  |      | 40617 |  1546K|    80   (2)| 00:00:01 |
    |*  4 |     SORT ORDER BY STOPKEY|      | 40617 |  2062K|    80   (2)| 00:00:01 |
    |   5 |      TABLE ACCESS FULL   | T    | 40617 |  2062K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("RN">=1190)
       2 - filter(ROWNUM<=1200)
       4 - filter(ROWNUM<=1200)
    Statistics
              0  recursive calls
              0  db block gets
            343  consistent gets
              0  physical reads
              0  redo size
           1063  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             11  rows processed
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid ;
    11 rows selected.
    Execution Plan
    Plan hash value: 168880862
    | Id  | Operation                      | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |       |  1200 | 91200 |   179   (2)| 00:00:03 |
    |*  1 |  HASH JOIN                     |       |  1200 | 91200 |   179   (2)| 00:00:03 |
    |*  2 |   VIEW                         |       |  1200 | 30000 |    98   (0)| 00:00:02 |
    |*  3 |    COUNT STOPKEY               |       |       |       |            |          |
    |   4 |     VIEW                       |       | 40617 |   475K|    98   (0)| 00:00:02 |
    |   5 |      INDEX FULL SCAN DESCENDING| T_IDX | 40617 |   793K|    98   (0)| 00:00:02 |
    |   6 |   TABLE ACCESS FULL            | T     | 40617 |  2022K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access("T".ROWID="T1"."RID")
       2 - filter("RN">=1190)
       3 - filter(ROWNUM<=1200)
    Statistics
              0  recursive calls
              0  db block gets
            349  consistent gets
              0  physical reads
              0  redo size
           1063  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
             11  rows processed
    SQL> select object_id, object_name, last_ddl_time from (select t1.*, rownum rn from (select * from t order by last_ddl_time desc) t1 where rownum <= 1200) where rn >= 1190 order by last_ddl_time desc ;
    11 rows selected.
    Execution Plan
    Plan hash value: 882605040
    | Id  | Operation           | Name | Rows     | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT      |     |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  1 |  VIEW                |     |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  2 |   COUNT STOPKEY       |     |     |     |          |          |
    |   3 |    VIEW            |     | 40617 |  1546K|    80   (2)| 00:00:01 |
    |*  4 |     SORT ORDER BY STOPKEY|     | 40617 |  2062K|    80   (2)| 00:00:01 |
    |   5 |      TABLE ACCESS FULL      | T     | 40617 |  2062K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("RN">=1190)
       2 - filter(ROWNUM<=1200)
       4 - filter(ROWNUM<=1200)
    Statistics
         175  recursive calls
           0  db block gets
         388  consistent gets
           0  physical reads
           0  redo size
           1063  bytes sent via SQL*Net to client
         385  bytes received via SQL*Net from client
           2  SQL*Net roundtrips to/from client
           4  sorts (memory)
           0  sorts (disk)
          11  rows processed
    SQL> set autotrace off
    SQL> spool offAs you will see, the join query here has to have an ORDER BY clause at the end to ensure that records are correctly sorted. You can not rely on optimizer choosing NESTED LOOP join method and, as above example shows, when optimizer chooses HASH JOIN, oracle is free to return rows in no particular order.
    The query that does not involve join always returns rows in the desired order. Adding an ORDER BY does add a step in the plan for the query using join but does not affect the other query.

  • Pagina inicial padrão Default

    Utilizo o Mozilla firefox como navegador padrão de toda a rede da empresa que é baseada em linux (ubuntu). A instalação do firefox foi feita "manualmente" no diretório "/opt/firefox" exatamente da forma que a Mozilla sugeri.
    O que estou precisando é "setar" a pagina inicial (HOME) de todos com a minha intranet, consegui fazer essa alteração apenas quando o firefox é instalado pelo repositorios (apt-get) que você faz a alteração no /etc/firefox/syspref.js adicionando a linha:
    user_pref("browser.startup.homepage","www.intranet.xxxx.net");
    . Gostaria de saber qual arquivo eu altero para fazer essa configuração, quando mando instalar no /opt/firefox , ou como fazer para que o firefox utilize o syspref.js do /etc para configura-lo.
    Vi que o firefox cria uma pref.js quando o usuário faz login, mas ele cria uma parta K42dk.Default (numero aleatório). que da para configura-lo, mas para isso tenho que esperar o usuário fazer o primeiro login e eu quero fazer que a pagina inicial com a intranet, aparece no default, já no primeiro login do usuário... existe essa possibilidade ?!?
    Desde já Agradeço.
    Obrigado

    Se na versão disponibilizada pelo ubuntu, você conseguiu fazer as alterações necessárias, por que não usá-la?

  • Problem in pagination

    hi,
    I am working on the pagination concept using JSP and SQL.
    I written stored procedure for pagination..its nicely working and i am using callable statement to call the procedure in my jsp code....if i am passing values within the parameter ..i am getting the answer....but i have to get the value at runtime...
    In my jsp code.i am calling the procedure like this:
    java.sql.CallableStatement proc =
    cn.prepareCall("{call newPage2('%telic%',2,10,24)}");
    its working fine...But i have to get the string from html..I have get the values at runtime rather than passing the values directly...
    Details about the above parameters which i have used in my code :
    The string that be searched - "telic"
    2 = Refers to the current page
    10 = page size(no of items per page)
    24 = total number of records;
    for Example if i am searching for the word "telic".I have the fields in the database such as names,address.
    The word "telic" has to be searched in the above fields.
    My doubts are:
    1) How do i pass the text from the HTML to the stored procedure.
    2) I am not sure about passing the values to a stored procedure at runtime.
         java.sql.CallableStatement proc =
    cn.prepareCall("{call newPage2(?,?,?,?)}");
         How should i pass the values at runtime instead of "?" mark.
    3)Suppose if i am using the getParameter method to get the string value..How can i pass the string variable instead of question mark(?).
    can anyone help me...
    Thanks in advance.

    Read the documentation for CallableStatement. There are methods for setting parameters.
    http://java.sun.com/j2se/1.4.2/docs/api/java/sql/CallableStatement.html

  • Number of currently displayed rows in report with pagination?

    Maybe I'm thinking to complicated, but ...
    In my report I use the HTMLDB_ITEM.CHECKBOX function in order to display a checkbox for each row:
    HTMLDB_ITEM.CHECKBOX(1,"ID",NULL,:P311_ASSIGNED,':') " "
    Some of the checkboxes are selected depending on whether there is an entry for them in a database table.
    As the report returns hundreds of rows, I use pagination (e.g. 15 rows per page).
    After checking/unchecking the checkboxes and submitting the page by clicking the save button, I want to do the following: For each row CURRENTLY DISPLAYED on the screen (1) check, whether its checkbox is currently checked or not (2a) If it is checked and there is not yet an entry -> add row to the db table (2b) If it is unchecked and there is an entry in the db table -> remove row from db table.
    How can I, on the server side, find out which rows (row ids) are currently displayed (using pagination), so that I check each of the currently displayed row ids for their existence in the database table? Is there any item stored on the server side, which tells me the row number of the first row currently displayed? Is there an item I can refer to, which tells me the amount of rows, which are displayed on one page?
    Your help would be very much appreciated!
    Konrad

    Hi Konrad,
    I will jump in. :-) Just have a few minutes before a meeting.
    I think you don't have to make it that complicated, where you have to know the current pagination.
    1) Your HTMLDB_ITEM.CHECKBOX has to contain as checked value #ROWNUM# as the row selector would do it.
    2) You have to create a hidden item where you store your customer id
    3) create another hidden item where you store if the customer has already the assignment
    4) In your process you are now able to loop through your arrays.
    DECLARE
        vRowNumber BINARY_INTEGER;
        vFound BOOLEAN;
    BEGIN
        -- insert new event assignments
        FOR ii IN 1 .. WWV_Flow.g_f01.COUNT -- your checkbox
        LOOP
            vRowNumber := WWV_Flow.g_f01(ii);
            -- no assignment yet?
            IF WWV_Flow.g_f03(vRowNumber) IS NULL -- your hidden field where you store if you have an assmnt
            THEN
                INSERT INTO xxx VALUES (WWV_Flow.g_f02(vRowNumber)); -- your customer id
            END IF;
        END LOOP;
        -- delete old event assignments
        FOR ii IN 1 .. WWV_Flow.g_f03.COUNT -- your hidden field where you store if you have an assmnt
        LOOP
            -- only if the event was already assigned
            IF WWV_Flow.g_f03(ii) IS NOT NULL
            THEN
                vFound := FALSE;
                FOR jj IN 1 .. WWV_Flow.g_f01.COUNT -- your checkbox
                LOOP
                    -- is the event still checked?
                    IF WWV_Flow.g_f01(jj) = ii
                    THEN
                        vFound := TRUE;
                        EXIT;
                    END IF;
                END LOOP;
                IF NOT vFound
                THEN
                    DELETE xxx WHERE CUSTOMER_ID = WWV_Flow.g_f02(ii);
                END IF;
            END IF;
        END LOOP;
    END LOOP;Haven't tested the code, but I think it should show the idea.
    Hope that helps
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com

  • Not getting all records in pagination

    I am also have a problem getting all records in the report as the post on Apr. 21,2004. My reports pagination stops at 500. When I set the 'max row count' to 100000. The pagination at the bottom of my page disapears. When I leave 'max row count' empty, it only goes from 1-500. No way to view records past the 500th record.
    I see there was a post on Apr. 21, 2004 about the same thing but it did not specify a fix or work around or if I'm missing a setting. (also tried the log off/on but did not help).
    *My pagination Scheme is 'Row Ranges 1-15 16-30 in select list(wiht pagination)'
    *My report has 1000+ records.
    Thanks, Paula

    The actual number of rows supported by the select list depends on how many rows you show on each page. If you go with the default of 15 rows, you would be able to use the select list with close to 5000 rows. If you increase the number of rows per page, the select list will work with even more rows.
    If the select list can't be used, it may make sense to consider using the "row ranges with set pagination" style. Set pagination lets you navigate from one set to the next instead of one page to the next, so you can navigate through your result set a lot quicker.
    However the best option for reports with that many rows would be "row ranges x-y", without showing the total number of rows. The reason is that the report renders a lot faster if you don't have the total number of rows calculated. In order to better be able to find certain records, I would recommend a search field on your report page that lets you filter the result set.
    Hope this helps,
    Marc

  • Report problem (Paginations show record count, report blank)

    I am using a custom report template to show data in detail form and allowing users to use the pagination to move from record to record. I have the maximum rows returned as 1.
    The problem is in a very specific set of circumstances if the query returns only two results the report shows nothing. The pagination show two records (using search engine pagination style) but nothing (with the exception of the top and bottom pagination bars) is displayed until the user clicks on one of the linked numbers.
    Has anyone had similar problems, does anyone have any idea how to correct this problem?
    Thanks in advance.
    Gary

    Check any branches to this page to see that they have "reset pagination for this page" checked. I had a problem with pagination where the user could specify query criteria and the branch back to the page was not resetting the pagination.
    Just a thought,
    Mike

  • Expanding text boxes, pagination and expanding to another page

    Attached is a link to a simple form which is actually part of a much larger form. It has several nested add and remove instances. I have three fairly simple issues I need to solve.
         1. Is it possible to set a text box to allow it to grow in height as information is added that exceeds the size of the text box. This feature is available as a property in Microsoft Access as an example. I know you can allow multiple lines but you can see them all without the expanding feature.
         2. This form is design to grow by adding instances. I would like to set up the pagination so it would flow to additional page(s). I think I would just like the line
    to continue to flow to the next page without creating a break in the primary instance if that makes sense (the top level of the instances - mode). This level could theoretically by larger than one page so this is probably best route to go. Currently it's not flowing at all to the 2nd page.
         3. Somehow I ended up with a 2nd page to the form. How do I delete that but yet have the expanding form automatically create a 2nd, 3rd (etc) page as required.
    http://share.planswift.com/download/?file=W0H3U2V5-GOPO-FI9G-1UIG-OTYPHTB46HB
    Thanks,
    Patrick

    Hi Patrick,
    I can't make changes to your form at the moment, but there are a few things you need to bear in mind. If you want items to expand and push objects down, then you will need a Flowed layout.
    See this example about making fields dynamic: http://assure.ly/g80MVY.
    Also this looks at the difference between Flowed (where you want to get to) and Positioned (where you are now) subforms: http://assure.ly/eSGQMt.
    Yes, just select the textfield and go to the LAyout palette. There under height, tick Expand to fit. If you preview this you will see that it expands, BUT will cross over objects beneath it. This is where you need to group objects in a Flowed subform, so that when it expands it will push objects down.
    The page needs to be set to Flowed. There are pagination settings available under the Object palette and you can start with Place = Follow previous and then Continue filling parent. You also want to make sure that for the subforms (and textfields) you have set in the Object palette that content is allowed to break over pages.
    Check your pagination settings.
    Hope that helps,
    Niall

  • Adding form pagination without the wizard

    Hello,
    I'm trying to add a form pagination feature into an existing page. When I'm trying to use the Create Form Pagination Wizard I'm getting the following error: "The Create Form Pagination Wizard uses the onChange JavaScript event to alert users when they are about to exit a page without saving their changes. Remove the onChange event from any item with a source of Database Column and restart the wizard."
    I have many items on this page with onchange event, and I really don't want to erase all of then, using the wizard, and retyping them again. Is there a way to bypass this problem? I'm actually looking to use the " Get Next or Previous Primary Key Value" process. Can I manually create this process without the "help" of the wizard?
    Thanks,
    Arie.

    Arie - Perhaps you could create a temporary form page with a "clean" form and then create the form pagination process there. Then copy that process to your existing form page. After the copy, edit the process and change all the item names, column names, etc., in the process definition page and create any items required to support it. Finally, delete the temporary form page.
    Scott

  • Can viewObject get a parameter from sessionScope to binding variable?

    hello,
    using Jdev11g ADF Fusion application
    Can viewObject get a parameter from sessionScope and assign into binding variable ? without using executeWithParameter
    Thanks
    greenApple

    A. Safwat,
    As I said before, I was not trying to be offensive, but simply to explain some of the shortcomings of one solution over another. One of the reasons people give such short answers is that many questions (including this one) have been asked and answered many many many times before on the forum. As to my reasons:
    1). Overkill - overkill because you are writing code to do what the framework already provides for you.
    2). Not bind-variable friendly - you are gluing in literals into a SQL statement. That means that Oracle will have to hard parse the query for each new value of the filter clause, yielding to poor performance, particularly in a multiuser environment. It should ideally be done using bind variables.
    3). Insecure (think about what happens if you put "'xyz' or 1=1" into the filterValue there) - not using bind variables is a security hole. Think through what happens if a filter criteria comes through like the one I mentioned.
    4). Inflexible - because you are overriding executeQueryForCollection, this VO becomes inflexible and can only be used in this particular place. Using the declarative approach outlined by Timo is more flexible
    5). Bad (ok, that's my opinion there) - OK, perhaps this was a bit offensive ;)
    Please don't take a critique of a post as offensive, as I assure you it was not intended to be in that spirit. As I mentioned, I greatly appreciate when people point out issues/problems/etc with my ideas, as that is the best way for me to learn. I have in the past written applications that were not bind-variable friendly, and I learned the downsides the hard way (system was horribly non-performant) - I wish someone had reviewed my approach and told me "bad idea" before the application made it into production.
    Respectfully,
    John

  • Custom pagination for APEX 4.2 interactive report using Page Zero

    Hi,
    I want to implement an «Custom pagination for APEX 4.2 interactive report» using a «page zero».
    I recently migrate from Apex 3.1 to Apex 4.2 and my «Custom pagination for APEX 3.1 interactive report» using a «page zero»  is not working any more.
    So now I try to adapt an excellent example of Jari Laine for 4.0 but using a page zero.
    I put the code JavaScript to Page zero but I must create an dynamic action to fire only for an interactive report region.
    It’s a good idea?
    Thank you

    Thought I would try once more with my DatePicker question.
    On the Apex.Oracle.Com website I have created a 1 page application that has an Interactive Report.
    [url http://apex.oracle.com/pls/apex/f?p=15655:1]
    user = 'test'
    password = 'test'
    I have 2 questions :
    (1) In IE7, press 'Actions', 'Filter'. On the Column dropdown list, select 'Order Timestamp'.
    Notice the prompt icon to the right of the 'expression'. This should change to the Datepicker, but in IE7 it does not. Try the samething in Firefox or Chrome and the Datepicker will appear.
    Is this a BUG, or does Apex 4.02 not support IE7 ?
    (2) In Firefox or Chrome, where you can now see the Datepicker, you will notice that it is the new style picker, not the old style ( called 'classic' ). I want to change it so that it shows the 'classic' datepicker not the new, but cannot see how to do it, if indeed you actually can.
    I would really appreciate it if someone could take a look and let me know if I am going mad, or if we need to get all our users onto IE8. We have now gone live with Apex 4.02 and need to resolve these issues.
    Thanks in advance.
    Edited by: DooRon on 10-Mar-2011 05:13

  • Performance problem creating rows on viewobject

    Hi,
    When a user pushes a button in my Oracle ADF 11.1.1.3.0 GUI,
    he triggers a method in my backing bean.
    This method is called insertNewForecastTable, that takes a (Tree)Map called forecastMap as input. (see below)
    ( The key of this map is a Timestamp,
    the value of this map is an object ForecastEntry.
    A ForecastEntry consists out of 10 ForecastParts, and each Forecastpart contains 4 long values. )
    private void insertNewForecastTable(Map forecastMap) {
    DCBindingContainer bc = (DCBindingContainer)getBindings();
    DCIteratorBinding ForecastIter = bc.findIteratorBinding("ForecastViewIterator");
    DCDataControl dc = ForecastIter.getDataControl();
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    ViewObject forecastVO = am.findViewObject("ForecastView");
    Set keys = forecastMap.keySet();
    Iterator keyIter = keys.iterator();
    RowSetIterator it = ForecastIter.getRowSetIterator();
    while (keyIter.hasNext()) {
    Long timestamp = (Long)keyIter.next();
    Timestamp ts = new Timestamp(timestamp);
    Row r = it.createRow();
    r.setAttribute(0, ts);
    ForecastEntry forecastentry = (ForecastEntry)forecastMap.get(timestamp);
    int j = 1;
    for (int i=0;i<10;i++) {
    ForecastPart forecastPart = forecastentry.getForecastPart(i);
    r.setAttribute(j,forecastPart.getHistory());
    j++;
    r.setAttribute(j,forecastPart.getForecast());
    j++;
    r.setAttribute(j,forecastPart.getTrend());
    j++;
    r.setAttribute(j,forecastPart.getLimit());
    j++;
    forecastVO.insertRow(r);
    am.getTransaction().commit();
    Configuration.releaseRootApplicationModule(am,true);
    Problem is : for 3360 entries in this table or viewobject, it takes 10 minutes (!!!) to complete this code.
    Bottleneck is the for-loop and the forecastVO.insertRow(r);
    Both timings are rising from 15 msec in the beginning to 500 msec at the end.
    Anyone has some ideas how to improve my performance ?
    Am I doing something wrong trying to create and insert 3360 rows in this table ?
    Thanks.

    Ok,
    My binding is back ok, so the nullpointer is gone.
    But the speed of processing 1000+ inserts into a table is still very poor.
    This is my code at the moment :
      +private void insertNewForecastTable(Map forecastMap) {+
        +DCBindingContainer bc = (DCBindingContainer)getBindings();+
        +DCIteratorBinding ForecastIter = bc.findIteratorBinding("ForecastViewIterator");+
        +DCDataControl dc  = ForecastIter.getDataControl();+
        +ApplicationModule am = (ApplicationModule)dc.getDataProvider();+
        +ViewObject forecastVO = am.findViewObject("ForecastView");+ 
        +RowSetIterator it = ForecastIter.getRowSetIterator();+
        +Set keys = forecastMap.keySet();+        
        +Iterator keyIter = keys.iterator();+
        +List nameList = new ArrayList();+
        +nameList.add("Timestamp");+
        +for (int i=1 ; i<=10; i ++) {+
          +String H = "H"+i;+
          +String F = "F"+i;+
          +String T = "T"+i;+
          +String L = "L"+i;+
          +nameList.add(H);+
          +nameList.add(F);+
          +nameList.add(T);+
          +nameList.add(L);+
        +}+
        +long time_begin = System.currentTimeMillis();+
        +int counter = 0;+
        +// for each timestamp+
        +while (keyIter.hasNext()) {+
          +// Get the timestamp.+
           +Long timestamp = (Long)keyIter.next();+
           +// convert long to timestamp+
           +Timestamp ts = new Timestamp(timestamp);+
           +// create new row in table+
           +Row r = it.createRow();+
          +List valueList = new ArrayList();+
          +valueList.add(ts);+
          +ForecastEntry forecastentry = (ForecastEntry)forecastMap.get(timestamp);+
          +for (int i=0;i<10;i++) {+
              +ForecastPart forecastPart = forecastentry.getForecastPart(i);+
              +valueList.add(forecastPart.getHistory());+
              +valueList.add(forecastPart.getForecast());+
              +valueList.add(forecastPart.getTrend());+
              +valueList.add(forecastPart.getLimit());+
          +}+
          +r.setAttributeValues(nameList, valueList);+
          +forecastVO.insertRow(r);+
          +counter++;+
          +if (counter % 100 == 0) {+
            +am.getTransaction().commit();+
            +System.out.println("Committing rows " + (counter-100) + " to " + counter );+
          +}+
        +}+
        +long time_end = System.currentTimeMillis();+
        +// commit+
        +am.getTransaction().commit();+
       +// Configuration.releaseRootApplicationModule(am,true);+
        +System.out.println("Total time to insert all rows : " + (time_end-time_begin ));+
      +}+It takes up to 500 seconds to insert 3000 rows !
    I also changed the update batch value from 100 to 5, but no difference.
    I'm now also committing every 100 rows.
    And at the end, I get a nullpointer exception at RowDataManager.getRowIndex(RowDataManager.java:191)
    All help welcome.

Maybe you are looking for