日期:2014-05-16 浏览次数:20410 次
SQL> create table ta (t1 varchar2(4000)); Table created SQL> declare 2 v_tmp varchar2(10000); 3 begin 4 v_tmp:='1'; 5 insert into ta (t1)values(v_tmp); 6 end; 7 / PL/SQL procedure successfully completed SQL> select * from ta; T1 -------------------------------------------- 1 SQL> declare 2 v_tmp varchar2(10000); 3 v_tmp1 varchar2(4000); 4 begin 5 for i in 1..5000 loop 6 v_tmp:=v_tmp||'1'; 7 end loop; 8 insert into ta (t1)values(substr(v_tmp,1,1)); 9 end; 10 / declare v_tmp varchar2(10000); v_tmp1 varchar2(4000); begin for i in 1..5000 loop v_tmp:=v_tmp||'1'; end loop; insert into ta (t1)values(substr(v_tmp,1,1)); end; ORA-01461: can bind a LONG value only for insert into a LONG column ORA-06512: at line 9 SQL> declare 2 v_tmp varchar2(10000); 3 v_tmp1 varchar2(4000); 4 begin 5 for i in 1..5000 loop 6 v_tmp:=v_tmp||'1'; 7 end loop; 8 v_tmp1:=substr(v_tmp,4000); 9 insert into ta (t1)values(v_tmp1); 10 end; 11 / PL/SQL procedure successfully completed