-- 添加表注释
COMMENT ON TABLE TEST.COMMON_SEQ IS '序号表';

-- 添加列注释
COMMENT ON COLUMN TEST.COMMON_SEQ.APP_CODE IS '应用编码';

-- 查询所有没注释的表
SELECT * FROM SYS.ALL_TAB_COMMENTS WHERE OWNER = '库名' AND COMMENTS IS NULL;

-- 查询所有没注释的列
SELECT * FROM SYS.ALL_COL_COMMENTS WHERE OWNER = '库名' AND COMMENTS IS NULL;

-- 表注释转语句 同步注释用
SELECT 'COMMENT ON TABLE '||OWNER||'.'||TABLE_NAME||' IS '''||COMMENTS||''';'
FROM SYS.ALL_TAB_COMMENTS WHERE OWNER = '库名' AND COMMENTS IS NOT NULL;

-- 列注释转语句 同步注释用
SELECT 'COMMENT ON COLUMN '||OWNER||'.'||TABLE_NAME||'.'||COLUMN_NAME||' IS '''||COMMENTS||''';'
FROM SYS.ALL_COL_COMMENTS WHERE OWNER = '库名' AND COMMENTS IS NOT NULL;