ukula 发表于 2016-11-14 06:18:11

DB2常用汇总

一、判断是否存在

查看表
select count(*) from syscat.tables where tabschema='yourschema' and tabname='yourtablename' and type='T'
select tabname from syscat.tableswhere 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')
页: [1]
查看完整版本: DB2常用汇总