Oracle数据库查询表结构、字段及注释信息
create or replace view sys.user_col_comments
oracle数据库表结构怎么看(table_name, column_name, comments)
as
select o.name, c.name, coment$
from sys."_CURRENT_EDITION_OBJ" o, l$ c, sys$ co
where o.owner# = userenv('SCHEMAID')
pe# in (2, 4)
and o.obj# = c.obj#
and c.obj# = co.obj#(+)
and c.intcol# = co.col#(+)
and bitand(c.property, 32) = 0 /* not hidden column */;
comment on table SYS.USER_COL_COMMENTS is 'Comments on columns of user''s tables and views';
comment on column SYS.USER_COL_COMMENTS.TABLE_NAME is 'Object name';
comment on column SYS.USER_COL_COMMENTS.COLUMN_NAME is 'Column name';
comment on column SYS.USER_COL_COMMENTS.COMMENTS is 'Comment on the column';
使⽤⽅式:
select * from user_col_comments

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。