- --生成所有表的注释
- 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') ;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28878983/viewspace-2133892/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28878983/viewspace-2133892/