Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL to generate insert statements for table row counts - help.

JayDee41Sep 27 2019 — edited Sep 27 2019

Hi Team,

Could anyone help with formatting a query to generate INSERT statements for getting row counts of a list of tables;

The query I have is;

select 'insert into table_count '||chr(13)||' select '||owner||'.'||table_name||', count(*) from '||owner||'.'||table_name||';' ||chr(13)||'commit;'

from dba_tables

where owner in ('DATAOWNER');

I want to be able to generate a list of statements that can insert the table name and row counts into the table table_count.

Any help much appreciated.

Thnx,

jd

This post has been answered by [Deleted User] on Sep 27 2019
Jump to Answer
Comments
Post Details
Added on Sep 27 2019
11 comments
1,354 views