db2查看表结构、表索引
1.1 db2查看表结构
SELECT * FROM "SYSIBM".syscolumns WHERE TBNAME = 'table_name ' AND TBCREATOR = 'SAFEDB2_TEST' //(sysindexes 、syscolumns...)
1.2 db2其他操作
ALTER TABLE table_name ALTER COLUMN column_name SET NOT NULL; //设置非空
ALTER TABLE table_name ALTER COLUMN column_name DROP NOT NULL ; //取消设置非空
CREATE UNIQUE INDEX index_name ON table_name(column_name); //增加唯一索引