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: cursors and sql%rowcount

Re: cursors and sql%rowcount

From: Graham Thornton <nero_at_chicagonet.net>
Date: 2000/03/03
Message-ID: <38C00A0C.6914D9D6@chicagonet.net>#1/1

Hi.

Why can't you add 'where rownum = 1' to your query?

HTH Graham

kal121_at_my-deja.com wrote:

> Hi,
>
> I have a cursor that can return one or several hundred rows at a time.
>
> The thing is, I only ever want just the first row. Right now I'm
> executing the cursor in a FOR LOOP. Then, IF SQL%ROWCOUNT = 1, I get the
> values for the first row returned then halt executing of the loop with a
> RETURN statement.
>
> It's just that this seems a clunky way to do this. Is there any other
> way to limit the result set?
>
> The sql statement does not lend itself to limiting output,
> unfortunately. And I cannot use ROWID for this purpose, as the data
> retrieved by the cursor is not necessarily sequential.
>
> thanks
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Mar 03 2000 - 00:00:00 CST

Original text of this message

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