DDR爱好者之家 Design By 杰米

 获取所有表、字段、索引等详细信息

SELECT 

d.name tbName,
COALESCE(d.remarks, '') tbDesc,
a.name columnName,
a.coltype columnType ,
decode(a.nulls,'Y','1','0') notNull,
decode(a.identity,'Y','1','0') auto,
a.longlength width,
a.scale precision,
COALESCE(a.remarks, '') comment,
decode(n.unique_colcount,'1','1','0') unique,
decode(n.uniquerule,'P','1','0') masterKey,
COALESCE(n.name, '') indexName
FROM
sysibm.syscolumns a
INNER JOIN sysibm.systables d on a.tbname=d.name
LEFT JOIN sysibm.sysindexes n on n.tbname=d.name and SUBSTR(colnames,2)=a.name
where 
d.type='T'and d.tbspace='USERSPACE1'
DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米