«

Aug 18

List all base tables in a DB2 database


--
-- List DB2 base Tables
--
select sit.TABLE_NAME, sit.TABLE_TYPE, substr(sit.TABLE_NAME,2,instr(sit.TABLE_NAME,'_')-2) as SYSTEM, sct.COLCOUNT, sct.CARD as ROWCOUNT
from SYSIBM.TABLES sit
inner join syscat.TABLES sct on sct.TABSCHEMA = sit.TABLE_SCHEMA and sct.TABNAME = sit.TABLE_NAME
where sit.TABLE_SCHEMA='@MVPADM'
and sit.TABLE_TYPE = 'BASE TABLE';

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>