you could execute query againest the metadata to retrive desired result.
Metadata catalog tables/view you could use SYSIBM.SYSTABLES A,SYSIBM.SYSCOLUMNS,syscat.tabconst, syscat.keycoluse, syscat.references
For Example:
Code:
select B.TBNAME,B.NAME,B.COLTYPE,B.LONGLENGTH,B.NULLS from SYSIBM.SYSTABLES A,SYSIBM.SYSCOLUMNS B WHERE A.NAME=B.TBNAME AND A.TYPE='T'
have a look to below link also post
Query to count number of coulmns in constraints