日期:2014-05-16  浏览次数:20403 次

DB2常用汇总
一、判断是否存在
查看表
select count(*) from syscat.tables where tabschema='yourschema' and tabname='yourtablename' and type='T'
select tabname from syscat.tables  where tabname= 'your_table_name '
查看索引
select * from syscat.indexes where tabname = upper('tablename')
查看外键
select * from SYSCAT.REFERENCES where tabname = upper('tablename')
查看触发器
select * from SYSCAT.TRIGGERS where tabname = upper('tablename')