正德厚生,臻于至善

oracle-获取数据库中所有表的注释 comments

set serveroutput on
set linesize  1000
set feedback off
set long 9999999
set pagesize 0
spool E:\nf\cux_comments.sql
select 'comment on table ' || table_name || ' is ' || '''' || comments ||
       ''';'
  from dba_tab_comments where owner='CUX'
 and comments is not null;

select 'comment on column ' || table_name || '.' || column_name || ' is ' || '''' ||
       comments || ''';'
  from dba_col_comments where owner='CUX';
spool off;
set serveroutput on
set linesize  1000
set feedback off
set long 9999999
set pagesize 0
spool E:\nf\all_cux_comments.sql
select 'comment on table ' || table_name || ' is ' || '''' || comments ||
       ''';'
  from dba_tab_comments where table_name like '%CUX%'
 and comments is not null;

select 'comment on column ' || table_name || '.' || column_name || ' is ' || '''' ||
       comments || ''';'
  from dba_col_comments where table_name like '%CUX%';
spool off;
赞(0) 打赏
未经允许不得转载:徐万新之路 » oracle-获取数据库中所有表的注释 comments

评论 抢沙发

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫

微信扫一扫

登录

找回密码

注册