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

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/database/280606.html

(0)
上一篇 2022年8月15日 06:59
下一篇 2022年8月15日 07:14

相关推荐

发表回复

登录后才能评论

WordPress 数据库错误: [Duplicate entry '81-7bc5f87d83893fa5db53603967a72d35' for key 'task_id_source_url_key']
insert into wp_autoblog_queue(task_id,source_url,source_url_key,create_date_time,not_check_stoped,post_interval) values(81,'http://www.52im.net/forum.php?mod=collection&action=view&ctid=16&page=3','7bc5f87d83893fa5db53603967a72d35',1735264649,0,0)