create or replace procedure test(s out string) is begin for i in 1..300 loop s:=s||to_char(i); end loop; end test;SQL> declare 2 s string(2000); 3 begin 4 test(s); 5 end; 6 /PL/SQL procedure successfully completed
declare str varchar2(1000):='...'; begin for i in 1..ceil(length(str)/255) loop if i=1 then dbms_output.put_line(substr(str,1,i*255)); else dbms_output.put_line(substr(str,(i-1)*255,i*255)); end if; end loop; end; /
可以。
begin
for i in 1..300 loop
s:=s||to_char(i);
end loop;
end test;SQL> declare
2 s string(2000);
3 begin
4 test(s);
5 end;
6 /PL/SQL procedure successfully completed
str varchar2(1000):='...';
begin
for i in 1..ceil(length(str)/255) loop
if i=1 then
dbms_output.put_line(substr(str,1,i*255));
else
dbms_output.put_line(substr(str,(i-1)*255,i*255));
end if;
end loop;
end;
/