打印Oracle的SQL
create or replace procedure put_line_unlimit(p_string in varchar2)
is
StrTemp long default p_string;
begin
loop
if instr(StrTemp,chr(13))=0 then
dbms_output.put_line(substr(StrTemp,1,200));
exit;
else
dbms_output.put_line(substr(StrTemp,1,instr(StrTemp,chr(13))-1));
StrTemp := substr(StrTemp,instr(StrTemp,chr(13))+1,length(StrTemp)-instr(StrTemp,chr(13)));
end if;
end loop;
end;
调用
declare
sName varchar2(40);
begin
sName := 'jack'||chr(13)||'lilei';
put_line_unlimit(sName);
end;
浙公网安备 33010602011771号