我收到此错误:
ORA-00932:数据类型不一致:得到了预期的REF ADDRESS_TYPE ADDRESS_TYPE
这是我的CREATE脚本:
CREATE OR REPLACE TYPE address_type AS OBJECT
(
house_name VARCHAR2(20),
street VARCHAR2(20),
city VARCHAR2(20),
postcode VARCHAR2(9)
)
/
CREATE TABLE addresses OF address_type;
CREATE TABLE customers
(
customer_id NUMBER(6),
title VARCHAR2(5),
firstname VARCHAR2(20),
surname VARCHAR2(20),
telephone VARCHAR2(12), --VARCHAR2 used as customer may use +44
address REF address_type SCOPE IS addresses
);
这是我的Insert
脚本:
INSERT INTO customers (customer_id, title, firstname, surname, telephone, address)
VALUES (1, 'mr', 'ross', 'xd', '01234881632',
address_type('exdee', 'may road', 'lurvey', 'rs34 8dt'));
我已尝试将REF address_type
放入插入表中,但这不起作用,它只是要求输入逗号。我也尝试从create table中删除REF
。我不确定我在这里做错了什么,会感激一些帮助。