DB2獲取當(dāng)前用戶表、字段、索引等詳細(xì)信息
更新時(shí)間:2014年07月18日 11:09:10 投稿:whsnow
這篇文章主要介紹了DB2獲取當(dāng)前用戶表、字段、索引等詳細(xì)信息的sql,需要的朋友可以參考下
獲取所有表、字段、索引等詳細(xì)信息
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'
相關(guān)文章
創(chuàng)建一個(gè)空的IBM DB2 ECO數(shù)據(jù)庫的方法
2008-01-01常見數(shù)據(jù)庫系統(tǒng)比較 DB2數(shù)據(jù)庫
常見數(shù)據(jù)庫系統(tǒng)比較 DB2數(shù)據(jù)庫...2007-03-03段云峰:DB2 9對(duì)企業(yè)有3點(diǎn)幫助
段云峰:DB2 9對(duì)企業(yè)有3點(diǎn)幫助...2007-04-04DB2中REVERSE函數(shù)的實(shí)現(xiàn)方法
有哥們?cè)谌豪飭朌B2有沒有自帶的reverse函數(shù),我測試一下,DB2確實(shí)內(nèi)置該函數(shù),但是oracle,sql server都內(nèi)置了該函數(shù),來看一下2016-02-02