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 -> Count # of records

Count # of records

From: Robert <robert_mulder_at_hotmail.com>
Date: Mon, 08 Apr 2002 15:16:29 GMT
Message-ID: <hvis8.38$PA6.1023@nreader1.kpnqwest.net>


Hi all,

I'm not that experienced in writing PL/SQL code and now I have to write a PL/SQL procedure to count the number of records in a given schema. So I created a cursor that retrieves all table names for a given schema, like ex. below

      CURSOR snaps_to_run IS
          SELECT   s.owner || '.' || s.table_name as get_table_names
          FROM     all_tables s
          WHERE    s.owner=in_schema_name
          ORDER BY s.table_name

In a loop I want to count the number of records for each table, and that's were it all goes wrong. I can't just say "select count(*) into variable from get_table_names, because it can't resolve the actual table name. Apparently I have to bind the real value.

Can anyone help me with this?

Thanks in advance,

Robert. Received on Mon Apr 08 2002 - 10:16:29 CDT

Original text of this message

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