打印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;

posted on 2015-11-24 13:42  金宝的博客  阅读(277)  评论(0)    收藏  举报

导航