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: Checking if more than 0 rows exist.

Re: Checking if more than 0 rows exist.

From: Jeremy <newspostings_at_hazelweb.co.uk>
Date: Tue, 10 May 2005 08:43:54 +0100
Message-ID: <MPG.1cea768d919fa351989e64@news.individual.net>


In article <d5og57$je0$1_at_news3.zwoll1.ov.home.nl>, Frank van Bortel says...
> > Select count(*) from combo_table where all fields match would count them all
> > but all I really need to know is if any exist (>0 rows).
> >
>
> Right question: define a cursor with all 5 columns concerned.
> Open the cursor - (attempt to) fetch any record.
> If found, you're OK - close cursor, 1 read done.
> If not found, you're OK - close cursor, 1 read done.
>
>

Do you think this is a better approach than using EXISTS as suggested (and proved to be faster) by Phil?

-- 

jeremy
Received on Tue May 10 2005 - 02:43:54 CDT

Original text of this message

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