问题
I try this statement
select schema_name , tabs_name ,
('select count(*) from' || schema_name ||'.'|| tabs_name)
from sysibm.systables
where schema_name = 'Sample'
I would like in the string type can be execute string or must be create procedure or any?
'select count(*) from' || schema_name ||'.'|| tabs_name
Thank you in advance from Thailand
回答1:
Try this:
Select TABLE_SCHEMA, TABLE_NAME, NUMBER_ROWS from qsys2.systablestat
Where TABLE_NAME = 'Sample'
来源:https://stackoverflow.com/questions/29303469/i-would-like-to-count-records-in-all-tables-in-the-schema-using-sql-for-db2-z-os