4
如果我有一个类型x_typ和亚型y_typ,是有可能创造x_typ的一个目的表,但把一个约束对y_typ之一即属性约束上亚型属性(甲骨文)
create table x_table of x_typ (
constraint constr_y check (y_typ.attribute1 < 5);
);
由于
如果我有一个类型x_typ和亚型y_typ,是有可能创造x_typ的一个目的表,但把一个约束对y_typ之一即属性约束上亚型属性(甲骨文)
create table x_table of x_typ (
constraint constr_y check (y_typ.attribute1 < 5);
);
由于
我能来最接近的是...
CREATE OR REPLACE TYPE x_typ AS OBJECT (record_type varchar2(1)) NOT FINAL;
/
CREATE OR REPLACE TYPE y_typ UNDER x_typ (attribute1 number) ;
/
create table x_table (x_col x_typ);
alter table x_table add constraint x_cons
check (1 = case when x_col is of (y_typ) then
treat (x_col as y_typ).attribute1 else 1 end);
嗨,我们被告知要使用这个语法'创建的x_typ'即不加列对象表中,而是每一行都是一个表x_table个人实例ce,但所有的例子(包括你的)创建一个列来检查......谢谢。 – joec 2010-02-26 18:07:46