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

Home -> Community -> Usenet -> c.d.o.server -> Re: query question

Re: query question

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Thu, 1 Apr 2004 16:25:17 -0500
Message-ID: <s4udnUK-OZGCF_Hd4p2dnA@comcast.com>

"Karl Hungus" <nnnnndddddd_at_hotmail.com> wrote in message news:kC%ac.1255$WA4.733_at_twister.nyc.rr.com...
|
| > sql is set oriented, not record oriented, so this is not a typical way
to
| > use the language
| >
| > typically this functionality is best handled by buffering the PKs, or
the
| > actual records, via the UI tool
| >
| > could you describe your process and toolset (and versions would be good,
| > too)?
| >
| > ;-{ mcs
|
|
| Its a web front end. In this case its not practical to cache the pks.
| Basically just looking for a quick and dirty way to do it with SQL.
|
| TIA
|
|

actually, that's what i do with my web front ends (PL/SQL Web Toolkit, store PKs in hidden form fields, retrieve page at a time)

what are you implementing the interface with?

regarding the SQL approach (standard disclaimer should go here) you would need to determine some sort criteria and retrieve the first row greater than or less than the previously selected row:

for next row:

    select *
    from (

           select *
           from   emp
           where  empno >= :current_empno -- or, if unique, just '>'
           and    rowid <> :current_rowid -- not required if sort value is
unique
           order by empno
           )

    where rownum = 1;

for previous row:

    select *
    from (

           select *
           from   emp
           where  empno <= :current_empno -- or, if unique, just '<'
           and    rowid <> :current_rowid -- not required if sort value is
unique
           order by empno desc
           )

    where rownum = 1

;-{ mcs Received on Thu Apr 01 2004 - 15:25:17 CST

Original text of this message

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