怎么导出Oracle中的所有表和字段的注释
本篇内容主要讲解"怎么导出Oracle中的所有表和字段的注释",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"怎么导出Oracle中的所有表和字段的注释"吧!
--生成所有表的注释
SELECT 'comment on table '||a.owner||'.'||a.table_name||' is '||''''||a.comments||''''||' ;' FROM Dba_Tab_Comments a
WHERE a.table_type IN ('TABLE','VIEW') AND
a.owner IN ('ACCT','APPQOSSYS','BILLSERVICE','BLDBANK','COMM','CPR','DIALYSIS','ECONSTAT','EMERGOB','EQUIPMENT',
'EXAM','EXFSYS','FLOWS_030000','FLOWS_FILES','HISUSER','IMESSAGE','INFECT','INPADM','INPBILL','INQUIRE','INSURANCE',
'IX','KBS','LAB','MDSYS','MEDADM','MEDREC','MHIS','MOBILE','MOTES','NURSING','OLAPSYS','ORDADM','ORDDATA','ORDSYS',
'OUTLN','OUTPADM','OUTPBILL','OUTPDOCT','PHARMACY','PHYEXAM','SCOTT','SSXT','SURGERY','TJHISRPT','TJRIS','TSMSYS') ;
--生成所有字段的注释
SELECT 'comment on column '||a.owner||'.'||a.table_name||'.'||a.column_name||' is '||''''||a.comments||''''||' ;' FROM Dba_Col_Comments a
WHERE a.owner IN ('ACCT','APPQOSSYS','BILLSERVICE','BLDBANK','COMM','CPR','DIALYSIS','ECONSTAT','EMERGOB','EQUIPMENT',
'EXAM','EXFSYS','FLOWS_030000','FLOWS_FILES','HISUSER','IMESSAGE','INFECT','INPADM','INPBILL','INQUIRE','INSURANCE',
'IX','KBS','LAB','MDSYS','MEDADM','MEDREC','MHIS','MOBILE','MOTES','NURSING','OLAPSYS','ORDADM','ORDDATA','ORDSYS',
'OUTLN','OUTPADM','OUTPBILL','OUTPDOCT','PHARMACY','PHYEXAM','SCOTT','SSXT','SURGERY','TJHISRPT','TJRIS','TSMSYS') ;
到此,相信大家对"怎么导出Oracle中的所有表和字段的注释"有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!