oracle comment on的用法
oracle
中用comment on
命令給表或欄位加以說明,語法如下:
COMMENT ON
{ TABLE [ schema. ]
{ table | view }
| COLUMN [ schema. ]
{ table. | view. | materialized_view. } column
| OPERATOR [ schema. ] operator
| INDEXTYPE [ schema. ] indextype
| MATERIALIZED VIEW materialized_view
}
IS 'text' ;
用法如下:
1.對錶的說明
comment on table table_name is 'comments_on_tab_information';
2.對錶中列的說明
comment on column table.column_name is 'comments_on_col_information';
3.檢視錶的說明
SQL> select * from user_tab_comments where TABLE_NAME='EMPLOYEES';
TABLE_NAME TABLE_TYPE COMMENTS
------------------------------ ----------- ----------
EMPLOYEES TABLE 員工表
SQL> select * from user_tab_comments where comments is not null;
TABLE_NAME TABLE_TYPE COMMENTS
------------------------------ ----------- --------------------------
EMPLOYEES TABLE 員工表
4.檢視錶中列的說明
SQL> select * from user_col_comments where TABLE_NAME='EMPLOYEES';
TABLE_NAME COLUMN_NAME COMMENTS
------------------------------ ------------------------------ ------------
EMPLOYEES EMPLOYEE_ID
EMPLOYEES MANAGER_ID
EMPLOYEES FIRST_NAME
EMPLOYEES LAST_NAME
EMPLOYEES TITLE
EMPLOYEES SALARY 員工薪水
SQL> select * from user_col_comments where comments is not null;
TABLE_NAME COLUMN_NAME COMMENTS
------------------------------ ------------------------------ -------------
EMPLOYEES SALARY 員工薪水
5.我們也可以從下面這些檢視中檢視錶級和列級說明:
ALL_COL_COMMENTS
USER_COL_COMMENTS
ALL_TAB_COMMENTS
USER_TAB_COMMENTS
6.刪除表級說明,也就是將其置為空
SQL> comment on table employees is '';
Comment added
SQL> select * from user_tab_comments where TABLE_NAME='EMPLOYEES';
TABLE_NAME TABLE_TYPE COMMENTS
------------------------------ ----------- -------------
EMPLOYEES TABLE
7.刪除列級說明,也是將其置為空
SQL> comment on column employees.salary is '';
Comment added
SQL> select * from user_col_comments where TABLE_NAME='EMPLOYEES';
TABLE_NAME COLUMN_NAME COMMENTS
------------------------------ ------------------------------ -------------
EMPLOYEES EMPLOYEE_ID
EMPLOYEES MANAGER_ID
EMPLOYEES FIRST_NAME
EMPLOYEES LAST_NAME
EMPLOYEES TITLE
EMPLOYEES SALARY
相關文章
- Oracle comment新增註釋Oracle
- pragma comment的使用
- ORACLE SEQUENCE用法Oracle
- 【Oracle的NVL函式用法】Oracle函式
- oracle樹中prior的用法Oracle
- oracle中的CURRVAL和NEXTVAL用法Oracle
- oracle中substr() instr() 用法Oracle
- 【TUNE_ORACLE】Oracle Hint之概念與用法Oracle
- Oracle行列轉換及pivot子句的用法Oracle
- [轉載] Oracle:start with...connect by子句的用法Oracle
- Oracle臨時表的用法總結FLOracle
- 非空校驗在oracle和mysql中的用法OracleMySql
- Oracle批量插入資料insert all into用法Oracle
- 【SQL】Oracle查詢轉換之 OR用法SQLOracle
- oracle正規表示式regexp_like的用法詳解Oracle
- 關於 laravel-like-comment評論外掛的使用Laravel
- 如何查詢GBase資料庫中表的comment資訊資料庫
- Oracle中Nextval用法SEQUENCE與SYS_GUID()OracleGUI
- mysql建立表的時候對欄位和表新增COMMENTMySql
- Oracle minus用法詳解及應用例項Oracle
- oracle中listagg()和wmsys.wm_concat()基本用法Oracle
- vue中報錯:[vuex] module namespace not found in mapActions(): comment/Vuenamespace
- oracle資料庫常用分析函式與聚合函式的用法Oracle資料庫函式
- Powerdesigner pdm檢視看不到表註釋comment問題
- IDEA Plugins:Show Comment(快捷顯示註釋)安裝及使用IdeaPlugin
- Python成功解決TypeError: __init__() missing 1 required positional argument: ‘comment‘PythonErrorUI
- 例項演示oracle資料塊狀態檢視v$bh的用法一 獲取oracle物件所佔用的資料塊Oracle物件
- Qdrant用法;Qdrant在langchain裡的用法LangChain
- indexOf()的用法Index
- Pythonyield的用法Python
- Promise的用法Promise
- errno的用法
- SQL AS 的用法SQL
- confirm的用法
- SUBMIT 的用法MIT
- tie的用法
- volatile的用法
- contentProvider的用法IDE