Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> The use of COUNT(*)
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
![]() |
![]() |