C/C++教程

oracle常用查字段注释

本文主要是介绍oracle常用查字段注释,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

select B.column_id , B.owner ,B.table_name , b.column_name,b.comments ,
case when B.data_type IN ('VARCHAR2','CHAR','NVARCHAR2','NCHAR' ) then B.data_type || '(' || B.CHAR_LENGTH || ')'
when B.data_type='NUMBER' THEN B.data_type || NVL2(B.DATA_PRECISION ,CASE WHEN B.data_scale='0' THEN '(' || B.DATA_PRECISION || ')' ELSE '(' || B.DATA_PRECISION || ','|| b.data_scale || ')' end ,'' )
else B.data_type end
as column_type from (
select a.column_id , a.owner, a.table_name, a.column_name ,c.COLUMN_NAME as colname , c.comments as comments ,a.data_type , a.CHAR_LENGTH,a.DATA_LENGTH,a.data_scale,a.DATA_PRECISION
from all_tab_columns a
left join all_col_comments c on a.owner=c.owner and a.table_name=c.table_name and a.COLUMN_NAME =c.COLUMN_NAME
where a.owner='按实际需要填约束' and
a.table_name in ('按实际需要填表名')
)B
order by B.owner,B.table_name,B.column_id asc

这篇关于oracle常用查字段注释的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!