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: Mark D Powell <Mark.Powell_at_eds.com>
Date: 9 May 2005 16:07:50 -0700
Message-ID: <1115680069.972925.206940@z14g2000cwz.googlegroups.com>


Interesting that no one mentioned the exists clause. This is exactly what an exists subquery is for: test to see if some condition is true and by design the statements stops processing as soon as one hit is found.

If you use pl/sql and choose logic like Frank posted since the cursor is populated by the OPEN and not by the FETCH statement, which returns a row to the client, be sure to use "and rownum = 1" to limit the work performed by the cursor.

HTH -- Mark D Powell -- Received on Mon May 09 2005 - 18:07:50 CDT

Original text of this message

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