我做了以下事情:

create or replace type my_row as object
    (
     lname varchar2(30),
     fname varchar2(30),
     MI char(1),
     hohSSN char (9),
     hohname VARCHAR2(63),
     hohDob char(10),
     dob DATE
     );

create or replace type eiv.my_rec as table of eiv.my_row;


但是然后像这样进行查询:

my_records my_rec

select '', '', '', '', '', '', sysdate bulk collect into my_records from dual;


给出错误ORA-00947: not enough values

我在这里怎么做错了?

最佳答案

当使用批量收集填充SQL类型时,我们需要包括行(而不是表)类型。

select my_row ('', '', '', '', '', '', sysdate )
bulk collect into my_records
from dual;

07-24 09:38
查看更多