Oracle comment on的用法
来源:互联网 发布:十三姨 知乎 斗鱼 编辑:程序博客网 时间:2024/04/28 16:06
Oracle comment on的用法
分类: 数据库相关技术 2011-09-07 16:46 1704人阅读 评论(1) 收藏 举报
oraclecommentstableusersqlmanager
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
更多 0
- oracle comment on的用法
- oracle comment on的用法
- Oracle comment on的用法
- Oracle comment on的用法
- Oracle comment on的用法
- oracle comment on的用法
- oracle comment on的用法
- Oracle中的comment on的用法
- oracle注释:comment on的重要意义
- oracle注释内容 comment on的重要意义
- comment on的重要意义
- 07-Oracle中的Comment on
- oracle comment注释用法说明
- oracle comment基本语句用法
- pragma comment的用法
- #pragma comment 的用法
- comment的用法
- oracle comment的语法
- ECMAScript引用类型
- 今天正式来到CSDN了!
- VC6中全局变量问题和错误:already defined in StdAfx.obj
- 360杀毒引发的DLL调用异常
- Hadoop2.2.0版本多节点集群及eclipse开发环境搭建
- Oracle comment on的用法
- OpenGL程序Demo(基于Mingw的GCC)
- JS中apply和call的联系和区别
- delphi中in的使用
- Hadoop实战-初级部分 之 Hadoop MapReduce JAVA API
- Json解析工具Jackson(使用注解) .
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context re
- 红黑树(Red Black Tree)
- 华为终端内部总结:盈利超额 将发放特别奖金