Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> how to use a cursor.

how to use a cursor.

From: Kyoichi Ozaki <k-ozaki_at_igs.inter-gate.co.jp>
Date: Fri, 06 Oct 2000 15:00:13 +0900
Message-ID: <39DD6A6D.16FE674E@igs.inter-gate.co.jp>

i am working on a web application(cgi) that access an oracle database. but i can't solve this one problem , so please help.

i am running a RedHat Linux 6.2 with php-3.0.15 , oracle 8.0.5. and here is the
situation:

i have a search page, and i need to sort the result of a query into divided pages.
and i searched the web to get this solution:

> SELECT a,b FROM (SELECT a,b,ROWNUM AS r FROM t WHERE ROWNUM <= 5+10)
> WHERE r>=5

but with this, i can't use `order by' and also there's no guarantee that i get the same
result everytime. so i looked in further to get this:

  0 SELECT STATEMENT Optimizer=RULE   1 0 VIEW

  2    1     COUNT (STOPKEY)
  3    2       TABLE ACCESS (FULL) OF 't'

but this example gives me no idea in how to exec the sql statement. (sorry for my
ignorance) so could someone give me a more detailed example?

like selecting from table t, the fields a,b,c and sorting by b and get 10 rows from the
5th row of the result ? Received on Fri Oct 06 2000 - 01:00:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US