|
自己写个put_line, 解决ORU-10028异常
create or replace procedure put_line(
v_string in varchar2,
v_len in integer)
as
v_curr_pos integer;
v_length integer;
v_printed_to integer;
v_last_ws integer;
skipping_ws boolean;
begin
if (v_string is null) then
return;
end if;
v_length := length(v_string);
v_curr_pos := 0;
v_printed_to := -1;
v_last_ws := -1;
skipping_ws := true;
while v_curr_pos < v_length loop
if substr(v_string,v_curr_pos+1,1) = ' ' then
v_last_ws := v_curr_pos;
if skipping_ws then
v_printed_to := v_curr_pos;
end if;
else
skipping_ws := false;
end if;
if v_curr_pos >= v_printed_to + v_len then
if v_last_ws <= v_printed_to then
dbms_output.put_line(substr(v_string,v_printed_to+2,v_curr_pos-v_printed_to));
v_printed_to:=v_curr_pos;
skipping_ws := true;
else
dbms_output.put_line(substr(v_string,v_printed_to+2,v_last_ws-v_printed_to));
v_printed_to := v_last_ws;
skipping_ws := true;
end if;
end if;
v_curr_pos := v_curr_pos + 1;
end loop;
dbms_output.put_line (substr(v_string,v_printed_to+1));
end put_line;
/ |
|