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). |
相关推荐
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 '...
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 TABLE table_name IS 'Your comment'; ``` 2. **Oracle修改表结构** - **添加新字段**: Oracle的语法与MySQL相似,但需要指定默认值: ```sql ALTER TABLE table_name ADD (column_name column_...
comment on column 表名.字段名 is '备注名'; eg: comment on column sys_cwzd.SCCLLJ is '上传材料路径'; 内容扩展: 添加新字段: alter table bulletin add citycode varchar(6) not null default 0; # ...
COMMENT ON COLUMN YEAR_PLAN.PLAN_ID IS 'ƻţP++λƻš磺P20120730001'; -- 计划ID COMMENT ON COLUMN YEAR_PLAN.TITLE IS 'ȼƻ'; -- 计划标题 COMMENT ON COLUMN YEAR_PLAN.START_DATE IS 'ʼʱ'; -- 开始时间 ...
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_...
comment on column Config_log.ConfigClass is '参数级别(0=不允许修改,1=允许客户化修改)'; comment on column Config_log.ConfigValue is '系统参数值'; comment on column Config_log.Remarks is '备注'; ...
comment on column ams_annual_comm_view.table_name is '字段所属表名'; ``` 在上面的示例中,我们添加了备注信息到视图 ams_annual_comm_view 的所有字段中。 查看备注信息 在 Oracle 中,我们可以使用以下语句...
COMMENT ON COLUMN table_name.column_name IS 'comments_on_col_information'; ``` 其中,`table_name`是表的名称,`column_name`是列的名称,`comments_on_col_information`是该列的注释。 3. 查看表的说明: ...
COMMENT ON { TABLE [ dbname:]{ table } | COLUMN [ dbname:] { table. } column } IS 'text'; ``` - `TABLE`子句用于给表或视图添加注释,即使是对视图,也要使用`TABLE`关键字。 - `COLUMN`子句则用于为表的...
On Error Resume Next Dim Tab ' running table For Each Tab In folder.tables If Not Tab.isShortcut Then Tab.name = Tab.comment Dim col ' running column For Each col In Tab.columns If col.comment...
COMMENT ON COLUMN tb_operator.Identitycard IS '证件号码'; COMMENT ON COLUMN tb_operator.Workdate IS '办证日期'; COMMENT ON COLUMN tb_operator.Tel IS '电话号码'; COMMENT ON COLUMN tb_operator.keepMoney...
COMMENT ON COLUMN table_name.column_name IS '字段的描述信息'; ``` 这里,`table_name`是包含该字段的表名,而`column_name`则是你需要添加描述的字段名,`字段的描述信息`应替换为对该字段的描述。 #### 四、...
找到“Column” -> “columnComment”,将`Value`设置为`comment on column [%QUALIFIER%]%TABLE%.%COLUMN% is %.q:COMMENT%`。这里,`%COLUMN%`代表字段名,同样,`.q:COMMENT%`会被实际注释内容替代。 4. **保存...
FROM table1 JOIN table2 ON table1.column = table2.column WHERE condition;` - **示例**: ```sql SELECT s.sname, p.pname FROM S s JOIN SPJ sp ON s.sno = sp.sno JOIN P p ON p.pno = sp.pno WHERE sp...
14. **为表字段添加注释**:使用`COMMENT ON COLUMN table_name.column_name IS 'comment';`。 15. **查看表字段注释**:查询`USER_COL_COMMENTS`或`ALL_COL_COMMENTS`视图,如`SELECT * FROM USER_COL_COMMENTS ...
COMMENT ON COLUMN table_name.column_name IS '注释内容'; ``` ### 删除表 当确定不再需要某张表时,可以使用`DROP TABLE`语句将其彻底删除: ```sql DROP TABLE table_name; ``` 以上操作涉及了Oracle数据库中...
SELECT CONCAT('create table ', TABLE_NAME, '(', substring(column_info, 1, length(column_info) - 1), ')', ' comment ', '"', TABLE_COMMENT, '"', ';') FROM ( SELECT TABLE_NAME, TABLE_COMMENT, GROUP_...
类似地,我们也可以使用`COMMENT ON COLUMN`为表的字段添加注释,如:`COMMENT ON COLUMN TEST_TBL_A.cif_no IS '客户号';` 这有助于解释字段的含义。 4. **添加主键和外键**: - 主键是标识表中唯一记录的字段,...
- 添加列注释:`COMMENT ON COLUMN table_name.column_name IS '注释内容';` 8. **查看列属性**: - `DESC table_name`提供列的简要描述,包括数据类型和是否可为空。 - `SELECT ... FROM user_tab_columns ...