程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> 導出oracle注釋,oracle注釋

導出oracle注釋,oracle注釋

編輯:Oracle教程

導出oracle注釋,oracle注釋


一個用戶下的表明細+表注釋+字段明細+字段注釋

select  ATC.OWNER,
        atC.TABLE_NAME,
        utc.comments,
        ATC.COLUMN_NAME,
        ATC.DATA_TYPE,
        ATC.DATA_LENGTH,
        ATC.NULLABLE,
        ucc.comments
from
    (select ATC.OWNER,
            atC.TABLE_NAME,
            ATC.COLUMN_NAME,
            ATC.DATA_TYPE,
            ATC.DATA_LENGTH,
            ATC.NULLABLE
     from all_tab_columns ATC
     where ATC.owner in ('UserName') ) atc
left outer join user_col_comments ucc
             on atc.table_name=ucc.table_name and 
                atc.column_name=ucc.column_name
left outer join user_tab_comments utc
             on atc.table_name=utc.table_name
order by atc.table_name,atc.column_name

 


多個用戶下的表明細+表注釋+字段明細+字段注釋

select  ATC.OWNER,
        atC.TABLE_NAME,
        ATC.COLUMN_NAME,
        utc.comments,
        ATC.DATA_TYPE,
        ATC.DATA_LENGTH,
        ATC.NULLABLE,
        ucc.comments
from
    (select ATC.OWNER,
            atC.TABLE_NAME,
            ATC.COLUMN_NAME,
            ATC.DATA_TYPE,
            ATC.DATA_LENGTH,
            ATC.NULLABLE
     from all_tab_columns ATC
     where ATC.owner in ('UserName1','UserName2') ) atc
left outer join all_col_comments ucc
             on atc.table_name=ucc.table_name and 
                atc.column_name=ucc.column_name
left outer join all_tab_comments utc
             on atc.table_name=utc.table_name
order by atc.table_name,atc.column_name

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved