加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

oracle存储过程打印字符串

(2012-12-10 10:20:28)
标签:

杂谈

分类: 数据库
create or replace procedure print_proc(str in varchar2) is

begin
dbms_output.put_line('lengthb(str) =' || lengthb(str));
if (lengthb(str) < 255) then
dbms_output.put_line(str);
else
for i in 1 .. length(str) - length(replace(str, chr(10))) + 1
loop
dbms_output.put_line(substr(str, instr(chr(10) || str, chr(10), 1, i), instr(str ||
chr(10), chr(10), 1, i) -
instr(chr(10) || str, chr(10), 1, i)));
end loop;
end if;
exception
when others then
dbms_output.put_line(sqlerrm);
dbms_output.put_line(dbms_utility.format_call_stack);
end print_proc;

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有