当我使用 wm_concat 将几个元组连接成一个元组时。
例如
ID 项目
1 '苹果'
2 '桃子'
2 '香蕉'
declare
v_name_l: varchar(100);
v_name_b: varchar(100);
begin
select wm_concat(Items) into v_name_l from Item group by ID having count(*)=1;
select wm_concat(Items) into v_name_b from Item group by ID having count(*)=2;
execute immediate ('Insert into apr values('||v_name_l||','||v_name_b||')');
end;
另一个表 apr 结构是
Name1 Name2
name1 和 nam2 是 varchar(100);
有一个错误引发
*execute immediate execute immediate ('Insert into apr values('||v_name_l||','||v_name_b||')')"
ORA-00913: too many values
我认为 wm_concat 将多行连接到一个字符串中;
我该如何解决?