Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to move cursor to skip couple of record.
Is rownum a column of every table? Should I create index to it for speed?
Thanks
Mark Gumbs wrote:
> You may have to keep a counter in your application on what records you want
>
> e.g in your application, counter = 20
>
> cursor c_data(v_counter in number) is
> select empno, ename
> from emp
> where rownum >= v_counter
> and rownum < v_counter + 10;
>
> You then call the cursor in your application with a parameter of counter
> .....for records in c_data(counter)...
>
> HTH
>
> Mark
>
> --------------------------
>
> Peizhong Wu wrote in message <3739DB52.D382C508_at_umich.edu>...
> >What I am trying to do is to implement a web application. Say, client can
> get a
> >
> >page of 10 rows, then he can press the "Previous 10" or "Next 10" button to
> get
> >
> >more.
> >
> >I do not know how people do this.
> >
> >Thanks
> >
> >Jerry Gitomer wrote:
> >
> >> Hi,
> >>
> >> You can, but you shouldn't. Oracle does not store data in a
> predictable
> >> sequence. If you are inserting a new row into a table it may be inserted
> >> anywhere. As a result you have no way of knowing what the 10th row in
> the
> >> table contains. If you have already retrieved the 10th row in the table
> and
> >> you know you will want to access again just save the unique key or the
> rowid
> >> of the row and use one or the other when you want to access that same row
> in
> >> the future.
> >>
> >> regards
> >>
> >> Jerry Gitomer
> >>
> >> Peizhong Wu wrote in message <3739C2C5.31D7B844_at_umich.edu>...
> >> >HI,
> >> >
> >> >How can I move cursor to #10 record without fetch the first 9 records?
> >> >
> >> >Thanks
> >> >
> >> >
> >
Received on Thu May 13 1999 - 15:31:40 CDT
![]() |
![]() |