当字符加起来超过120个字符时,还能执行第2条记录的操作?
我这里会提示如下的信息: 1 declare
2 v_name_str varchar2(1100);
3 begin
4 for rs in (select distinct u_name from test1 where name='aa') loop
5 v_name_str :=v_name_str||' '||rs.u_name;
6 end loop;
7 if substr(v_name_str,1,120) is not null then
8 insert into test2 values(1,'aa',v_name_str);
9 end if;
10 if substr(v_name_str,121,120) is not null then
11 insert into test2 values(2,'aa',v_name_str);
12 end if;
13* end;
14 /
declare
*
ERROR 位于第 1 行:
ORA-01401: 插入的值对于列过大
ORA-06512: 在line 8
我这里会提示如下的信息: 1 declare
2 v_name_str varchar2(1100);
3 begin
4 for rs in (select distinct u_name from test1 where name='aa') loop
5 v_name_str :=v_name_str||' '||rs.u_name;
6 end loop;
7 if substr(v_name_str,1,120) is not null then
8 insert into test2 values(1,'aa',v_name_str);
9 end if;
10 if substr(v_name_str,121,120) is not null then
11 insert into test2 values(2,'aa',v_name_str);
12 end if;
13* end;
14 /
declare
*
ERROR 位于第 1 行:
ORA-01401: 插入的值对于列过大
ORA-06512: 在line 8
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货