ORA-00932:不一致的数据类型:预期NUMBER得到SYSTEM.ADDRESSTYPE

时间:2016-04-28 02:40:29

标签: sql oracle

create type AddressType as object
(
house_no number(3), 
street varchar2(30),
town varchar2(20),
postcode varchar2(8),
country varchar2(2)
);

注意:那是我的AddressType属性

我创建了下面的表并插入了以下记录,其中我收到了提及的错误

create table players
(

player_no number(2),
player_first_name varchar2(30),
player_initials varchar2(3),
player_last_name varchar2(25),
national_ranking number(2),
matches_won number(3),
home_address AddressType,
phone_number varchar2 (13),
primary key (player_first_name)
)

insert into players
values (2,'Bokamoso', 'B.M', 'Ramocha', 5, 8, AddressType('453, '12 Main Street', 'Mochudi', 'POB453', 'BW'), '75645345');

insert into players
values (3,'Kitso', 'K.M', 'Mathe', 7, 12, AddressType(531, '315 Kgoro Street', 'Malotwane', 'POB873', 'BW'), '72557084');

insert into players
values (1,'Thabiso', 'T.M', 'Mathe', 1, 45, AddressType(897, '036 Sandton Road, Johannesburg', 'POB676', 'SA'), '000776966928');

insert into players
values (5,'Muller', 'M.M', 'Medupe', 7, 13, AddressType(343, '4th Church Street', 'Pretoria', 'POB456', 'SA'), '024272665345');

insert into players
values (7,'Kennedy', 'K.L', 'Leburu', 8, 9, AddressType(245, '5th Avenue Bojale', 'Gaborone', 'POB532', 'BW'), '74530984');

insert into players
values (10,'Atang', 'A.K', 'Akanyang', 10, 22, AddressType(123, '2nd Avenue Bogwera', 'Francistown', 'POB843', 'BW'), '77909308');

0 个答案:

没有答案