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: Getting the first matching record???

Re: Getting the first matching record???

From: Alex Heney <heneya_at_entcf3.agw.co.bt.uk>
Date: 1997/04/18
Message-ID: <33573972.4464@entcf3.agw.co.bt.uk>#1/1

george wrote:
>
> Try 'exists': I.E.
>
> select 'X' from dual where
> exists (select blah blah blah from...
>
> exists is supposed to stop after the first matching row is found.
>

I think you are working under a mis-understanding here. The sub-query will stop when the first record is found, but you have no data from that record. This will tell you whether a matching record exists, but he wanted to RETURN the first matching record.

The obvious way (as has already been suggested) is a cursor.

-- 
The above posting represents the personal opinions of the author and
is not to be taken as official (or unofficial) policy or opinions of 
his employer.

Alex Heney, Living in the Global Village.
Received on Fri Apr 18 1997 - 00:00:00 CDT

Original text of this message

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