2015-07-31 5 views
2

Я трачу много времени на поиск, где я совершил ошибку, но я не смог найти его, когда он собирается вставить последнюю запись, появляется сообщение об ошибке, показывающее «ORA-00936: отсутствует выражение»Как решить эту проблему, пожалуйста, помогите мнеORA-00936: отсутствует ошибка выражения при вводе значений

create type pearson_types as object(
name varchar2(50), 
sysID char(6) 
)NOT FINAL; 

create type doctor_types under pearson_types(
regNo char(10), 
specialization varchar2(25) 
) 

create table doctor of doctor_types(
regNo primary key 
) 

create type hospVisits_types as object(
hosChg float, 
vDate varchar2(20), 
refDoc REF doctor_types, 
docChg float 
) 

create type hospvisits_tbl_types as table of hospVisits_types 

create type phone_arr as VARRAY(3) of char(10) 

create type patient_types under pearson_types 
(
id char(10), 
dob varchar(20), 
phone phone_arr, 
hospVisits hospvisits_tbl_types 
) 

create table patients of patient_types(
id primary key 
)nested table hospVisits store as Hospital_tables 

alter table Hospital_tables add scope for (refDoc) is doctor 

insert into doctor values ('Dr.k.perera','D001','1223441234','Gynecologist'); 
insert into doctor values ('Dr.p.weerasingha','D002','1234421131','Dermatalogist'); 
insert into doctor values ('Prof .S. Fernando','D003','2342111322','Pediatrician'); 
insert into doctor values ('Dr.k.Sathgunanathan','D004','2344114344','Pediatrician'); 


insert into patients values('Sampath Weerasingha','P001','732821122V','23-JAN-73',phone_arr('0332124222'),hospvisits_tbl_types(hospVisits_types(50.00,'24-MAY-06',select ref (a) from doctor a where a.regNo='1223441234',500.00))) 

ответ

1

Добавить скобки ВЫБРАТЬ заявления внутри SQL заявление:

insert into patients values(
    'Sampath Weerasingha','P001','732821122V','23-JAN-73',phone_arr('0332124222'), 
    hospvisits_tbl_types(hospVisits_types(50.00,'24-MAY-06', 
     (-- ADD ME 
      select ref (a) from doctor a where a.regNo='1223441234' 
     ) -- ADD ME 
    ,500.00)) 
); 
+0

большое спасибо Джон Хеллер, к сожалению, я не хватает репутации, чтобы upvote ответ простите за это.. :/ – dgcharitha

Смежные вопросы