DB2獲取當前用戶表、字段、索引等詳細信息
更新時間:2014年07月18日 11:09:10 投稿:whsnow
這篇文章主要介紹了DB2獲取當前用戶表、字段、索引等詳細信息的sql,需要的朋友可以參考下
獲取所有表、字段、索引等詳細信息
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'
相關文章
國內(nèi)學院派專家對DB2 9新產(chǎn)品贊不絕口
國內(nèi)學院派專家對DB2 9新產(chǎn)品贊不絕口...2007-04-04
DB2 數(shù)據(jù)庫創(chuàng)建、表的ixf文件導出導入示例
這篇文章主要介紹了DB2 數(shù)據(jù)庫創(chuàng)建、表的ixf文件導出導入示例,需要的朋友可以參考下2014-08-08

