Q: 如何创建空值占位属性表
A:
创建方式
1、带有空值占位属性的模板表
a)create table template_1 (a int,b text) with (template_alloc_space_for_null = true);
--创建一个名字为 template_1的模板表。该表具有空值占位模板属性,凡是参照该表创建的表,都会自动带有空值占位属性。
b)create table sub_table as select * from template_1;
--参照模板表创建一个名为 sub_table的表。
c)select relname,reloptions from sys_class where relname in ('TEMPLATE_1','SUB_TABLE');
查询两张表的属性(reloptions),结果会显示 template_1表的reloptions为 template_alloc_space_for_null,sub_table表的reloptions为 alloc_space_for_null。
2、只带有空值占位属性的表
a)create table alloc_table(c1 int,c2 text) with (alloc_space_for_null=true);
b)select relname,reloptions from sys_class where relname='ALLOC_TABLE';
结果显示 alloc_table表的reloptions属性为 alloc_space_for_null.