• dbms_output超长问题


    关于10g以下dbms_output.put_line超长的问题

    对于10gdbms_output.put_line的长度是没有限制
    如果报错:buffer overflow,执行如下语句即可:
    set serveroutput ON SIZE UNLIMITED FORMAT WORD_WRAPPED
    由于10g以下dbms_output.put_line的长度有限制
    所以今天特意写了一个按照回车符来截取字符串,也就是按行截取,然后打印出来的过程,希望对某些人有用!


    create or replace procedure print_proc(str in varchar2) is
    /*
    --打印字符串,调试的时候用
    --由于字符串过长,超过了dbms_output.put_line的长度,故采用本程序分行打印出来
    --@auther:Z.X.T
    --@date:2007-6-26
    */
    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;

  • 相关阅读:
    1.计算机初识
    re模块前瞻后顾 快速
    getattr 对类使用
    sklearn iris快速
    numpy c_
    sorted函数 字典按值倒序 实现
    logging快速入门
    configparser快速应用
    reduce 和 map 函数
    一个简单的类继承
  • 原文地址:https://www.cnblogs.com/zyizyizyi/p/2497822.html
Copyright © 2020-2023  润新知