导出oracle用户下的表的注释

--表字段注释

SELECT 'comment on column '|| t.table_name||'.'||
t.colUMN_NAME||' is '|| ''''||
t1.COMMENTS ||''' '||';'
FROM User_Tab_Cols t, User_Col_Comments t1
WHERE t.table_name = t1.table_name
AND t.column_name = t1.column_name(+) and t1.COMMENTS is not null;

--表注释
SELECT distinct 'comment on table '|| t.table_name||' is '|| ''''||
t1.COMMENTS ||''' '||';'
FROM User_Tab_Cols t, user_tab_comments t1
WHERE t.table_name = t1.table_name and t1.COMMENTS is not null;

猜你喜欢

转载自blog.csdn.net/sinat_23502039/article/details/83856555