Oracle导出当前用户下所有表的表注释,字段 字段注释

来源:互联网 发布:搜狗皮肤编辑器mac 编辑:程序博客网 时间:2024/05/16 11:26
select distinct TABLE_COLUMN.*,
                TABLE_NALLABLE.DATA_TYPE,
                TABLE_NALLABLE.NULLABLE
  from (select distinct utc.table_name  table_name,
                        utc.comments    table_comments,
                        ucc.column_name column_name,
                        ucc.comments    column_comments
          from user_tab_comments utc, user_col_comments ucc
         where utc.table_name = ucc.table_name
           and utc.table_name not like '%_B'
           and utc.table_name not like '%_Z'
           and utc.table_name not like '%1%') TABLE_COLUMN,
       (select distinct table_name, column_name, nullable, DATA_TYPE
          from user_tab_cols
         where table_name not like '%_B'
           and table_name not like '%_Z'
           and table_name not like '%1%') TABLE_NALLABLE
 where TABLE_COLUMN.column_name = TABLE_NALLABLE.column_name
   and TABLE_COLUMN.TABLE_NAME = TABLE_NALLABLE.table_name;
0 0
原创粉丝点击