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 -> The use of COUNT(*)

The use of COUNT(*)

From: Lai King Leung <LaiKing_at_syslogic.com>
Date: Fri, 10 Jul 1998 08:43:59 GMT
Message-ID: <01bdabde$e3f537f0$92cc0bc3@carrera_09>


Could anyone tell me about the use of COUNT(*)? I currently use the comamnd

SELECT COUNT(*) INTO v_count FROM tbl_data WHERE ... in my PL/SQL program unit, to determine whether there are any records to be processed.

In some cases I use the command
SELECT COUNT(*) INTO v_count FROM tbl_tmpdata to determine if there is any data in the table.

I've been told that it is very inefficient to use COUNT(*) and that I should declare a CURSOR and look at the %FOUND attribute instead ??

I would appreciate any suggestions on the use of COUNT(*) especially when it should be used, and when it should be avoided at all cost.

Thank-you in adavnce
Regards
Lai King Received on Fri Jul 10 1998 - 03:43:59 CDT

Original text of this message

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