您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

oracle怎么增加列注释

2024/4/27 10:31:45发布22次查看
在oracle中,可以利用“comment on column 表名.列名 is '列注释';”增加列注释;comment是注释的意思, comment on命令用于给表或字段加以说明,也即添加注释,column用于设置列的数据内容。
本教程操作环境:windows10系统、oracle 11g版、dell g3电脑。
oracle怎么增加列注释给列加注释:
sql>comment on column 表.列 is '列注释';
扩展:
1、给表填加注释:sql>comment on table 表名 is '表注释";
2、给列加注释:sql>comment on column 表.列 is '列注释';
3、读取表注释:sql>select * from user_tab_comments where comments is not null;
4、读取列注释:sql>select * from user_col_commnents where comments is not null and table_name='表名';
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
添加注释的好处:
1.可以通过sql语句快速查询,只要知道表名和字段名定位注释极方便快速。
2.注释内容是存储在字典表里的,只要表结构还在,那么sql脚本即使没有了也可以定位查询。
3.不需要猜字段是什么意思,因为在简表的时候已经给了没有二意的注释,后期承接明确。
推荐教程:《oracle视频教程》
以上就是oracle怎么增加列注释的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product