Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Query question find next, find previous
Steffen Krug wrote:
>
> I have a question regarding the "find previons" "find next" problem in
> SQL databases.
Exactly what *problem* are we talking about here?
> Is there a way to find ONE row of a table when querying by index with
> standard SQL?
>
> Today I'm using cursors to hold the tuple and fetch forward 1 but this
> is not very elegant, because the DBServer is overloaded when he has to
> serve many connections. Storing the result in a Client local object is
> also not an option, because one table has more than 10000 row's.
>
> What would you recommend to solve the problem?
>
I am not really sure if I comletely understand the problem. If you are
executing a query that returns many rows and you can get by with just
one,
then just narrow the WHERE criteria to where just one row qualifies. If
nothing else "WHERE rownum < 2" will work. If you need all the rows,
then
you are going to have to buffer them either at the server or on the
client!
-- Tomm Carr -- "Can you describe your assailant?" "No problem, Officer. That's exactly what I was doing when he hit me!"Received on Thu Jul 17 1997 - 00:00:00 CDT