Home » SQL & PL/SQL » SQL & PL/SQL » nb of records
nb of records [message #220857] Thu, 22 February 2007 07:05 Go to next message
maoro
Messages: 310
Registered: May 2005
Senior Member
hello
i need a scripts that returns the table name and the number of records for each table in the HR sample schema for example
thanks
for youe help
Re: nb of records [message #220859 is a reply to message #220857] Thu, 22 February 2007 07:12 Go to previous messageGo to next message
pmaupoil
Messages: 40
Registered: February 2007
Location: France
Member
spool cnt_tb_output.SQL

SELECT 'SELECT COUNT(*) ' || '|| '' -- ' || table_name || '''' || ' FROM ' || table_name || ';'
FROM all_tables t
WHERE t.owner = 'HR';

spool OFF

[Updated on: Thu, 22 February 2007 07:19]

Report message to a moderator

Re: nb of records [message #220860 is a reply to message #220857] Thu, 22 February 2007 07:12 Go to previous message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
just collect the stats and check user_tables.num_rows.
Be advised that, unless the stats are updated, num_rows may be reliable.
Previous Topic: i want 100 th record ..
Next Topic: procedure to load excel file into the database
Goto Forum:
  


Current Time: Sat Dec 03 12:06:40 CST 2016

Total time taken to generate the page: 0.13679 seconds