[size=medium][color=red]一、判断是否存在[/color][/size]
查看表
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')