I need to select all the table row count from a db2 database.
I have a query to select all the schema and table name:
select rtrim(tabschema)||'.'||rtrim(tabname) as tableName from syscat.tables where tabschema = 'COM' order by tabname;
This query give me list of the table name of the database.
I would like to do something like:
select count(*) from tableFromTheFirstQuery
Where the tableFromThePreviousQuery is subsitute by the tableName of my first query.
I can not do like
select count(*) from (select rtrim(tabschema)||'.'||rtrim(tabname) as tableName from syscat.tables where tabschema = 'COM' order by tabname);
I will only get result of count of my first query.
I am not sure the way is exist or not. Basically I need to save all the table row counts in a text file before doing DR activity.
Kindly advise