Results 1 to 3 of 3

Thread: record count

  1. #1
    Join Date
    Jan 2007
    Posts
    47

    Unanswered: record count

    Hi,

    I have created around 40 tables in a database. Is there a way I can count total records in all the tables at a time instead of doing table by table?

    Your help is appreciated.

    Thanks,

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    If you have gathered statistics, and you don't really expect all numbers to be accurate, you might try with
    Code:
    SELECT table_name, num_rows 
    FROM user_tables;
    Otherwise, create a script in SQL*Plus as
    Code:
    SET header OFF
    SET feedback OFF
    SPOOL count_records.sql
       
    SELECT 'SELECT COUNT(*) FROM '||table_name||';' FROM user_tables;
    
    SPOOL OFF
    Now run @count_records.sql at the SQL*Plus prompt.

  3. #3
    Join Date
    Jan 2007
    Posts
    47
    Thank you so much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •