Oracle 获取表注释、字段注释

-- 表名注释
select *  from all_tab_comments where Table_Name='B_MERCH'  and owner = 'POSP';
-- 表字段注释
select * from all_col_comments where Table_Name='B_MERCH'
-- 一步实现
SELECT b.column_name columnName --字段名
,b.data_type dataType --字段类型
,b.data_length dataLength --字段长度
,b.data_precision dataPrecision --字段长度
,b.data_scale dataScale --字段长度
,b.NULLABLE nullable --可为空
,a.comments comments --字段注释
FROM all_col_comments a --注释表
,all_tab_columns b --列表
WHERE a.table_name = b.table_name and a.OWNER = b.OWNER and a.Column_name = b.Column_name and
a.table_name = 'B_MERCH' and a.OWNER='POSP'
通过知识/经验的分享,节省开发者的时间.
原文地址:https://www.cnblogs.com/ysloong/p/14700355.html