From: kal121@my-deja.com
Subject: cursors and sql%rowcount
Date: 2000/03/03
Message-ID: <89ovce$qbo$1@nnrp1.deja.com>#1/1
X-Http-Proxy: 1.0 x26.deja.com:80 (Squid/1.1.22) for client 63.226.206.137
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Fri Mar 03 18:13:38 2000 GMT
X-MyDeja-Info: XMYDJUIDkal121
Newsgroups: comp.databases.oracle.server
X-Http-User-Agent: Mozilla/4.61 [en] (X11; U; Linux 2.2.12-20 i586)


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.


