Home  >  Article  >  Database  >  How to modify table comments in oracle

How to modify table comments in oracle

WBOY
WBOYOriginal
2022-03-07 16:04:235538browse

In Oracle, you can use the "comment on" command to modify table comments. This command is used to describe the table or field, that is, to add comments. The syntax is "comment on table table name is 'comment of the table. information';".

How to modify table comments in oracle

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

How to modify table comments in oracle

Use the comment on command in Oracle to explain the table or field.

Usage is as follows:

1. Description of the table:

comment on table table_name is '对表的说明';

2. Description of the columns in the table:

comment on column table.column_name is '对表中列的说明';

3. View the table Description

select * from user_tab_comments where table_name = 'employees';

4. View the descriptions of the columns in the table

select * from user_col_comments where table_name = 'employees';

5. View the descriptions of the columns in all tables in the database

select * from user_col_comments where comments is not null;

6. Delete table-level or column-level descriptions , set it to empty immediately

comment on table employees is '';
comment on column employees.salary is '';

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How to modify table comments in oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn