Comment is a keyword for Oracle database system, so it can be used to name an indication or field name
The comment keyword is used to annotate tables and fields, enabling users to understand the structure of a table and the meaning of a database object.
Thirdly, the user can query the data information of the table or field through the data dictionary view, and the corresponding view can be queried as follows:
1. Accessing the user's comment information The data dictionary view to query (the date directory views)
user_tab_comments; Table notes: There are three fields table_name,table_tpye,comments
user_col_comments; table field Note: There are three fields table_name,clumn_name,comments
2. Accessing other user's comment information The data dictionary view to query (the date directory views)
all_tab_comments; Table notes: There are four fields owner,table_name,table_tpye,comments
all_col_comments; table field Note: There are four fields owner,table_name,clumn_name,comments
3. DBA Authority user can access all user's comment information to query the data dictionary view (the date directory views):
dba_tab_comments; Table notes: There are four fields owner,table_name,table_tpye,comments
dba_col_comments; table field Note: There are four fields owner,table_name,clumn_name,comments
Iv. examples of use of comment:
CREATE TABLE Ob_call_date_log
(
call_id VARCHAR2 (60);
project_id VARCHAR2 (30);
COMMENTS VARCHAR2 (200)
)
You can write in the SQL script:
SELECT * from ob_call_date_log;//Add notes to Table
Comment on table ob_call_date_log is ' This table is a statement information table '
View notes for a table
SELECT * from user_tab_comments where table_name= ' ob_call_date_log '//Add notes to Column
Comment on Columm ob_call_date_log. PROJECT_ID is ' Project ID '
View column notes this time to label the table name and the column name
SELECT * from user_col_comments where table_name= ' Ob_call_date_log ' and column_name= ' project_id '
This gives you an understanding of the database tables and the fields of the table.
Creating tables for Oracle database and adding notes to tables and fields