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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Limiting the resultset returned from a SELECT to the first N rows?

Re: Limiting the resultset returned from a SELECT to the first N rows?

From: Michael G. Schneider <mgs_software_at_compuserve.com>
Date: 1997/11/04
Message-ID: <01bce93d$6df4ae00$0201dede@mum>#1/1

I would like to use a cursor, but my development environment is Microsoft Visual Basic. And there seems to be no way to transfer the resultset created in a stored procedure back through ODBC to an RdoResultset. At least I haven't succeeded until now - neither with the Oracle nor with the Microsoft ODBC driver.

Michael G. Schneider

mgs_software_at_compuserve.com

> Stop doing this!!
> We have had this misinformation disseminated (and corrected) too many
> times on this NG.
>
> ROWNUM is evaluated before ORDER BY, so the results of the above version
> of the query are arbitrary.
>
> In any sensible interface (i.e. NOT SQL*Plus), the correct way is to
> open a select cursor (including ORDER BY), and explicitly FETCH the
> number of rows you want.
>
> SQL*Plus allows you no control over the number of rows fetched from an
> ordered query and should be avoided for most production systems, except
> as a mechanism for executing very simple statements or, in this case, a
> PL/SQL block where the appropriate logic can be embedded.
Received on Tue Nov 04 1997 - 00:00:00 CST

Original text of this message

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