`

comment on table and column

阅读更多
comment [Oracle SQL]
       

comment on table  some_table       is 'some hopefully meaningful comment for some_table';
comment on table  some_view        is 'Views can also be commented, yet the statement is still: comment on table';
comment on column some_table.col_1 is 'Be sure to really give some meaningful comment';
comment on column some_view.col_1  is 'Useless, or wrong comments, are worse than no comment at all';

The comment statement allows to store some comments about tables, views or columns in the data dictionary.
Even when views are commented, the syntax is comment on table.
The comments for tables and views can be retrieved with something like

column comments format a50
select table_name, comments from user_tab_comments where table_name like 'SOME%';

TABLE_NAME                     COMMENTS
------------------------------ --------------------------------------------------
SOME_TABLE                     some hopefully meaningful comment for some_table
SOME_VIEW                      Views can also be commented, yet the statement is
                               still: comment on table

Similarly, the comments for columns can be found with something like

column comments format a50
select table_name, column_name, comments from user_col_comments where table_name like 'SOME%';

TABLE_NAME                     COLUMN_NAME                    COMMENTS
------------------------------ ------------------------------ --------------------------------------------------
SOME_TABLE                     COL_1                          Be sure to really give some meaningful comment
SOME_TABLE                     COL_2
SOME_TABLE                     COL_3
SOME_VIEW                      COL_1                          Useless, or wrong comments, are worse than no comm
                                                              ent at all

SOME_VIEW                      COL_2
SOME_VIEW                      COL_3

See also comments (PL/SQL).
分享到:
评论

相关推荐

    2019年行政区域规划表(3月更新)

    comment on column SYS_AREA.area_no is '行政区划编号'; comment on column SYS_AREA.area_name is '行政区划名称'; comment on column SYS_AREA.lev is '行政级别'; comment on column SYS_AREA.uplev is '...

    数据库表设计—水电费缴费系统.pdf

    10 comment on column admin.admin_id is '管理员编号'; 11 comment on column admin.admin_loginname is '管理员登录⽤户名'; 12 comment on column admin.admin_password is '管理员登录密码'; 13 comment on ...

    数据库表设计—水电费缴费系统(1).pdf

    10 comment on column admin.admin_id is '管理员编号'; 11 comment on column admin.admin_loginname is '管理员登录⽤户名'; 12 comment on column admin.admin_password is '管理员登录密码'; 13 comment on ...

    2020-05全国身份证归属地数据插入SQL、PDF和Excel.rar

    comment on table t_h_idcard_admin_region is '身份证6位行政区编码表'; comment on column t_h_idcard_admin_region.regionname is '行政区名称'; comment on column t_h_idcard_admin_region.regioncode is '6位...

    国家省市区标准编码

    COMMENT ON COLUMN "public"."tb_base_district"."district_code" IS '行政区划代码'; COMMENT ON COLUMN "public"."tb_base_district"."district_name" IS '行政区划名称'; COMMENT ON COLUMN "public"."tb_base_...

    Oracle备注生成工具

    comment on column Config_log.ConfigClass is '参数级别(0=不允许修改,1=允许客户化修改)'; comment on column Config_log.ConfigValue is '系统参数值'; comment on column Config_log.Remarks is '备注'; ...

    Oracle 创建主键自增表示例代码

    前言 本篇文章给大家主要介绍的是在oracle中如果创建自增长表的方法,这里要用到序列。下面话不多说,我们来看示例代码。 示例代码 create table tb_student ...comment on column "tb_student"."id" is '主

    plsqldev13.0.0.1882x32主程序+ v12中文包+keygen

    The editor now highlights all table.column occurrences in a select statement when clicking on the table name in the statement: Editor now highlights all field occurrences in a select statement when ...

    sql在一个表中添加字段并添加备注的方法

    comment on column 表名.字段名 is '备注名'; eg: comment on column sys_cwzd.SCCLLJ is '上传材料路径';   内容扩展: 添加新字段: alter table bulletin add citycode varchar(6) not null default 0; # ...

    Oracle练习.txt

    SQL>comment on column 表.列 is '列注释'; 注释已创建。 查询该用户下的注释不为空的表 SQL> select * from user_tab_comments where comments is not null; 5.如何在ORACLE中取毫秒? select systimestamp from ...

    jeecgboot-vue3 v3.4.3 资源

    ADD COLUMN `db_is_persist` tinyint(1) NULL COMMENT '是否需要同步数据库字段, 1是0否' AFTER `db_is_null`; update onl_cgform_field set db_is_persist = 1; Online表单 代码生成支持在线预览代码 支持表单右

    小型点在商务项目

    create table APPOINT ( id INTEGER not null, ...comment on column APPOINT.orderstatus is '1-新预约 2-处理中 3-已完成 4-已关闭'; alter table APPOINT add constraint PK_APPOINT primary key (ID);

    Oracle事例

    comment on column 表名.列名 is \'注释\'; 17、分布式数据库,创建数据库链路 create [public] database link LINKNAME [connect to USERNAME identified by PASSWORD] [using \'CONNECT_STRING\'] 可以在...

    PLSQL.Developer v11.0.4.1774 主程序+ v11中文包+keygen

    DDL for indexes on virtual columns would specify the column expression instead of the column name Fixed Session > Set Main Connection menu icon transparency issue Using the Search Next function in a ...

    WordPress 3 Search Engine Optimization.pdf

    Going viral with the Share on Facebook plugin (and several others) 217 Automating twitter posts with Tweet This 218 Promoting your business or blog with YouTube 218 Using YouTube as a hosting and ...

    PLSQL.Developer v11.0.0.1762 主程序+ v10中文包+keygen

    You can now use a Totals=[mode:column] directive in a comment section of the SQL Window to display column totals Test Window enhancement New debugger button: Run to cursor line DBMS Output tab page ...

    PLSQL.Developer(X32) v12.0.1.1814主程序+ v11中文包+keygen

    The result set selection can now be copied as an expression list: "column in (value, value, ...)" by right-clicking on a selection and selecting "Copy as expression list" from the popup menu....

    plsqldev12.0.4.1826x32主程序+ v12中文包+keygen

    The result set selection can now be copied as an expression list: "column in (value, value, ...)" by right-clicking on a selection and selecting "Copy as expression list" from the popup menu....

    PLSQL.Developer(X64) v12.0.1.1814 主程序+ v11中文包+keygen

    The result set selection can now be copied as an expression list: "column in (value, value, ...)" by right-clicking on a selection and selecting "Copy as expression list" from the popup menu....

    plsqldev12.0.4.1826x64主程序+ v12中文包+keygen

    The result set selection can now be copied as an expression list: "column in (value, value, ...)" by right-clicking on a selection and selecting "Copy as expression list" from the popup menu....

Global site tag (gtag.js) - Google Analytics