Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: number of rows in a table

Re: number of rows in a table

From: Kenneth C Stahl <BlueSax_at_Unforgettable.com>
Date: Thu, 30 Sep 1999 07:38:58 -0400
Message-ID: <37F34BD2.48BA6805@Unforgettable.com>


The ONLY way that you can determine the number of rows in a table without opening a cursor and sweeping through each row is with the count(*) function.

The num_rows column in user_tables, all_tables, dba_tables, etc. is only populated when statistics are run and even then it is only accurate as of that moment since the count is not updated dynamically.

Owais Anjum wrote:
>
> Hello
>
> How do I find the number of rows in a table without using the count(*)
> query. I though that num_rows column in user_tables (and a few other
> views) is meant for the job, but when I query this view, it gives me
> a null for all tables.
> With this behavior of num_rows, another question that comes into my mind
> is that what purpose does this column serve? I checked out the comments
> on this column which do say that it should return the number of rows in
> a table...
>
> Confused
> Owais
>
> --
> Owais Anjum
> Senior Software Engineer
> Kaps Computing, Pakistan
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Thu Sep 30 1999 - 06:38:58 CDT

Original text of this message

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