我创建了两个对象T_PERSONS,T_BUSINESS_PERSON,其中T_BUSINESS PERSON是一个子类型,T_PERSONS是一个超类型。
---创建T_PERSONS OBJECT ---
CREATE OR REPLACE
TYPE T_PERSONS AS OBJECT
( id integer,
first_name varchar2(10),
last_name varchar2(10),
dob DATE,
phone varchar2(12),
address t_address,
) NOT FINAL;
---创建T_BUSINESS_PERSON OBJECT ---
CREATE TYPE t_business_person UNDER t_persons
(title varchar2(20),
company varchar2(20)
);
现在我创建了一个对象表object_customers
CREATE TABLE object_customers OF t_persons
将数据插入object_customers
INSERT INTO object_customers VALUES
(t_persons(1,'Jason','Bond','03-APR-1955','800-555-1211',
t_address('21 New Street','Anytown','CA','12345')
));
在这种情况下,数据已正确插入
INSERT INTO object_customers VALUES
(t_business_person(2,'Steve','Edwards','03-MAR-1955','800-555-1212',
t_address('1 Market Street','Anytown','VA','12345'),'Manager','XYZ Corp'
));
现在在这种情况下发生了错误
Error-attribute or element value is larger than specified in type.
请帮助。
答案 0 :(得分:0)