I would like to count records in all tables in the schema using SQL for DB2 z/OS v9

旧城冷巷雨未停 提交于 2020-01-15 12:15:28

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!