INSERT INTO PatientTbl (sysID,id,name,dob,phone,hospVisits)
VALUES (
'P002',
'491221019V',
'Dulani Perera',
'3-FEB-49',
phone_arr_ty(0112233211),
hospVisitsNt_ty_tbl(
hospVisits_ty(
75.00,
'25-MAY-06',
(SELECT REF(d)
FROM DoctorTbl d
WHERE d.regNo = 2342111322),
550.00
)
),
hospVisitsNt_ty_tbl(
hospVisits_ty(
90.00,
'29-MAY-06',
(SELECT REF(d)
FROM DoctorTbl d
WHERE d.regNo = 2344114344),
300.00
)
)
);
/
与上面的查询一样,我试图将值插入ORDBMS中的嵌套表。
然后生成上面的错误。如何将数据插入到包含多行嵌套表的表中?请帮我尽快解决这个问题
答案 0 :(得分:0)
您尝试插入两列hospVisitsNt_ty_tbl ... 正确的插入是:
INSERT INTO PatientTbl (sysID,id,name,dob,phone,hospVisits)
VALUES (
'P002',
'491221019V',
'Dulani Perera',
'3-FEB-49',
phone_arr_ty(0112233211),
hospVisitsNt_ty_tbl(
hospVisits_ty(
75.00,
'25-MAY-06',
(SELECT REF(d)
FROM DoctorTbl d
WHERE d.regNo = 2342111322),
550.00
),
hospVisits_ty(
90.00,
'29-MAY-06',
(SELECT REF(d)
FROM DoctorTbl d
WHERE d.regNo = 2344114344),
300.00
)
)
);