0
我想在嵌套表中插入一個裁判,但我不斷收到錯誤SQL錯誤:ORA-00936:缺少表達SQL錯誤 - ORA-00936:缺少表達
相關類型和表如下如下:
create type TP1_PROPRIETE as object (
NO_PROPRIETE number(10),
ADRESSE_PRO varchar2(20),
VILLE_PRO varchar2(20),
NB_PIECES_PRO number(2));
/
create type TP1_CAPROPRO as object (
REF_PROPRIETE_CAPROPRO ref TP1_PROPRIETE);
/
create type TP1_CAPROPRO_NT as table of TP1_CAPROPRO;
/
create type TP1_PARTENAIRE as object (
NOM_COMPLET_PAR varchar2(40));
/
create type TP1_PARTENAIRE_NT as table of TP1_PARTENAIRE;
/
create type TP1_PROPRIETAIRE as object (
NO_PROPRIETAIRE number(10),
NOM_COMPLET_PROR varchar2(40),
REF_PARTENAIRES_PROR TP1_PARTENAIRE_NT,
REF_PROPRIETES_PROR TP1_CAPROPRO_NT);
/
create table TP1_PROPRIETAIRE_T of TP1_PROPRIETAIRE
nested table REF_PARTENAIRES_PROR store as TP1_PARTENAIRE_NT_PROR
nested table REF_PROPRIETES_PROR store as TP1_CAPROPRO_NT_PROR;
/
create table TP1_PROPRIETE_T of TP1_PROPRIETE (
constraint CT_NB_PIECES_NON_NEG check (NB_PIECES_PRO > 0));
/
這裏是插入:
insert into TP1_PROPRIETE_T
values(1465798654,
'1170 Victory',
'New York',
5);
/
insert into TP1_PROPRIETAIRE_T
values(9654255475,
'Mike Ross',
TP1_PARTENAIRE_NT(TP1_PARTENAIRE('Andre Ross')),
TP1_CAPROPRO_NT(TP1_CAPROPRO(select ref(p)
from TP1_PROPRIETE_T p
where p.NO_PROPRIETE = 1465798654)));
/
我得到執行最後插入時出現以下錯誤:
Error starting at line 117 in command: insert into TP1_PROPRIETAIRE_T values(9654255475, 'Mike Ross', TP1_PARTENAIRE_NT(TP1_PARTENAIRE('Andre Ross')), TP1_CAPROPRO_NT(TP1_CAPROPRO(select ref(p) from TP1_PROPRIETE_T p where p.NO_PROPRIETE = 1465798654))) Error at Command Line:121 Column:39 Error report: SQL Error: ORA-00936: missing expression 00936. 00000 - "missing expression" *Cause: *Action:
從我從SO和其他論壇讀到的錯誤很可能是在最後一個選擇ref(p)的地方......但語法對我來說似乎很好,所以我真的不知道爲什麼我得到這個錯誤。謝謝你的時間。