Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to export comments for all tables and fields in Oracle

Shulou Source: shulou.com Published: 2022-06-02 05:25:12 10月29日 Update

This article focuses on "how to export comments for all tables and fields in Oracle". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to export comments for all tables and fields in Oracle.

-- generate comments for all tables

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')

-- generate comments for all fields

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')

At this point, I believe you have a deeper understanding of "how to export comments for all tables and fields in Oracle". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Comments fields content learning generation practical deeper interested practical practical easy to operate methods more friends websites channels inquiries Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia macOS Microsoft Xiaomi MySQL