oracle使用comment注释的方法
2013-04-01 17:09
253 查看
在oracle中有时候需要用到字段注释,那么就需要用到comment,那么comment的语法是怎样的呢,现在我来总结一下,以备以后使用的时候方便查看:
先创建一个表,例如:
create table AA(
a_id number primary key not null,
a_name varchar(20)
);
comment on table AA is '我的表';---------表注释
comment on column AA.a_id is '编号'; -------列注释
测试效果:
select * from user_tab_comments where comments is not null;
TABLE_NAME TABLE_TYPE COMMENTS
------------------------------ ----------- --------------------------------------------------------------------------------
select * from user_tab_comments where table_name is '我的表';
TABLE_NAME TABLE_TYPE COMMENTS
------------------------------ ----------- --------------------------------------------------------------------------------
AA TABLE 我的表
select * from user_column_comments where comments is not null;
TABLE_NAME COLUMN_NAME COMMENTS
------------------------------ ------------------------------ --------------------------------------------------------------------------------
AA AID 编号
先创建一个表,例如:
create table AA(
a_id number primary key not null,
a_name varchar(20)
);
comment on table AA is '我的表';---------表注释
comment on column AA.a_id is '编号'; -------列注释
测试效果:
select * from user_tab_comments where comments is not null;
TABLE_NAME TABLE_TYPE COMMENTS
------------------------------ ----------- --------------------------------------------------------------------------------
select * from user_tab_comments where table_name is '我的表';
TABLE_NAME TABLE_TYPE COMMENTS
------------------------------ ----------- --------------------------------------------------------------------------------
AA TABLE 我的表
select * from user_column_comments where comments is not null;
TABLE_NAME COLUMN_NAME COMMENTS
------------------------------ ------------------------------ --------------------------------------------------------------------------------
AA AID 编号
相关文章推荐
- PB中自动生成的sql语句,在comment不存在时,自动使用name字段作为注释的设置方法
- ORACLE中的KEEP()使用方法
- 免安装Oracle客户端使用PL/SQL连接Oracle的2种方法
- Oracle的游标使用方法 三种循环
- Eclipse中设置方法注释模板并使用方法注释
- [Oracle]ASP.NET中使用ODP.NET的DeriveParameters方法得到存儲過程的參數列表並傳值.
- oracle round函数的使用方法 .
- Eclipse中设置方法注释模板并使用方法注释
- Xcode升级8.0后注释快捷键不能使用的解决方法
- Pyhton注释符号使用方法及规范
- ORACLE中对in操作使用变量绑定的方法
- IDEA使用笔记(十)——设置Java方法注释
- Windows平台使用RMAN命令自动删除Oracle过期归档日志的方法
- Oracle db中禁止使用sqlplus的方法
- 在python中使用cx_Oracle模块出现“DLL Load failed”的处理方法
- oracle decode函数使用方法
- 解决linux下oracle无法使用上下键的方法
- Linux下卸载ORACLE的多种方法(参考使用)
- Oracle 单实例 从32位 迁移到 64位 方法(二)-- 使用 RMAN Restore 示例
- Oracle 单实例 从32位 迁移到 64位 方法(三)-- 使用导出导入 说明