开发者

oracle collection not enough values

开发者 https://www.devze.com 2023-01-03 02:59 出处:网络
I did following: create or replace type my_row as object ( 开发者_高级运维lname varchar2(30), fname varchar2(30),

I did following:

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; 

but then doing query like:

my_records my_rec

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

gives error ORA-00947: not enough values

what can i be doing wrong here?


When populating SQL types with bulk collect we need to include the row (not the table) type.

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


no FROM clause.

try FROM DUAL

0

精彩评论

暂无评论...
验证码 换一张
取 消