GBase 8a数据库集群支持表的注释comment ,字段的注释,本文介绍表创建时的注释以及表注释和字段注释的装修。
建表
在建表语句里,直接在字段和表定义后面,加上comment 关键字,后面加上字符串即可。
根据现有规定,comment的最大长度是2000个字符。
gbase> create table testcomment(id int comment '编号', name varchar(100) comment '姓名') comment '测试注释';
Query OK, 0 rows affected (Elapsed: 00:00:00.29)
gbase> show create table testcomment;
+-------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| testcomment | CREATE TABLE "testcomment" (
"id" int(11) DEFAULT NULL COMMENT '编号',
"name" varchar(100) DEFAULT NULL COMMENT '姓名'
) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' COMMENT='测试注释' |
+-------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (Elapsed: 00:00:00.00)
gba