oracle 新增註釋

楊奇龍發表於2011-03-16
表的註釋:
yang@rac1>desc user_col_comments
 Name                       Null?    Type
 -------------------------- -------- ------------
 TABLE_NAME                 NOT NULL VARCHAR2(30)
 COLUMN_NAME                NOT NULL VARCHAR2(30)
 COMMENTS                            VARCHAR2(4000)

yang@rac1>comment on table tchar is ' 這是一個測試表';
Comment created.
yang@rac1>select table_name ,comments from user_tab_comments;
TABLE_NAME                     COMMENTS
------------------------------ -----------------------
TCHAR                           這是一個測試表

表中欄位的註釋:
yang@rac1>desc user_col_comments
 Name                      Null?    Type
 ------------------------ -------- ----------------------------
 TABLE_NAME               NOT NULL VARCHAR2(30)
 COLUMN_NAME              NOT NULL VARCHAR2(30)
 COMMENTS                          VARCHAR2(4000)

yang@rac1>comment on column tchar.val is ' 測試 來自客戶 ';
Comment created.
yang@rac1>col comments for a45
yang@rac1>select comments from user_col_comments where table_name='TCHAR' and column_name='VAL';

COMMENTS
---------------------------------------------
 測試 來自客戶



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-689584/,如需轉載,請註明出處,否則將追究法律責任。

相關文章