你的位置:首页 > 数据库

[数据库]导出oracle注释


一个用户下的表明細+表注释+字段明细+字段注释

select ATC.OWNER,    atC.TABLE_NAME,    utc.comments,    ATC.COLUMN_NAME,    ATC.DATA_TYPE,    ATC.DATA_LENGTH,    ATC.NULLABLE,    ucc.commentsfrom  (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') ) atcleft outer join user_col_comments ucc       on atc.table_name=ucc.table_name and         atc.column_name=ucc.column_nameleft outer join user_tab_comments utc       on atc.table_name=utc.table_nameorder 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.commentsfrom  (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') ) atcleft outer join all_col_comments ucc       on atc.table_name=ucc.table_name and         atc.column_name=ucc.column_nameleft outer join all_tab_comments utc       on atc.table_name=utc.table_nameorder by atc.table_name,atc.column_name