oracle添加和查看注释
1、给表加注释
COMMENT ON TABLE TABLENAME IS '用户表';
2、查看表的COMMENT
SELECT * FROM USER_TAB_COMMENTS WHERE TABLE_NAME='TABLENAME';
3、给字段加注释
COMMENT ON COLUMN TABLENAME.COLNAME IS 'OOXX';
4、查看字段的COMMENT
SELECT * FROM USER_COL_COMMENTS WHERE TABLE_NAME='TABLENAME';
5、查看字段的详细信息
SELECT
T.TABLE_NAME 表名,
T.COLUMN_NAME 字段名,
T.DATA_TYPE 数据类型,
T.DATA_LENGTH 长度,
T.DATA_PRECISION 整数位,
T.DATA_SCALE 小数位,
T.NULLABLE 允许空值,
T.DATA_DEFAULT 缺省值,
C.COMMENTS 备注
FROM USER_TAB_COLUMNS T,
USER_COL_COMMENTS C
WHERE A.TABLE_NAME = B.TABLE_NAME
AND A.TABLE_NAME = 'TABLENAME';