我想指望使用SQL对DB2 z满足架构中的所有表中的记录/ OS V9(I would like t

2019-10-22 09:46发布

我尝试这个说法

select schema_name , tabs_name ,
('select count(*) from' || schema_name ||'.'|| tabs_name)
from sysibm.systables
where schema_name = 'Sample'

我想在字符串类型可以是执行字符串或必须创建过程或任何?

'select count(*) from' || schema_name ||'.'|| tabs_name

谢谢你在泰国提前

Answer 1:

尝试这个:

Select TABLE_SCHEMA, TABLE_NAME, NUMBER_ROWS from qsys2.systablestat
Where TABLE_NAME = 'Sample'


文章来源: I would like to count records in all tables in the schema using SQL for DB2 z/OS v9