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: How to limit rows in PL/SQL?

Re: How to limit rows in PL/SQL?

From: Martin Drautzburg <drautzburg_at_altavista.net>
Date: 21 Apr 2001 16:17:50 +0200
Message-ID: <87oftqgwvl.fsf@altavista.net>

"Richard Piasecki" <ogo_at_mailexcite.com> writes:

> Is there a way to limit the number of rows Oracle returns in a query?
> For example, if I execute a query like: SELECT f1 INTO :x

I would be interesting for me to know, why you want to fetch a row without caring which one. I have seen you cursor aproach over and over but I never quite understood why this is needed at all.

If you want to check for the existence of a row you could use a where exists clause. But I guess there are other situations that I am not aware off.

Generally speaking: oracle tries hard to inform you if there is more than one row, where there should be only one. Using a cursor bypasses this mechanism. You may eventually have corrupted data without knowing about it. Received on Sat Apr 21 2001 - 09:17:50 CDT

Original text of this message

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