• PLSQL存储过程传出大量异常错误信息


    1:  plsql存储过程中将程序大量异常错误信息,以clob类型变量传出

    CREATE OR REPLACE PROCEDURE list_product_read(p_code     IN OUT NOCOPY NUMBER,
                                                  p_err_mesg IN OUT NOCOPY CLOB) AS
        ----------------------------------------------------------------------------------------
        --商品目录接口下发
        --1.Date:20180724
        --Author:xeeyung
        --Description:
        --
    
        --------------------------------------------------------------------------------------------------------
        v_log VARCHAR2(4000);
    
        v_strs VARCHAR2(32767);
        v_clob CLOB;
    
    BEGIN
        p_code := 0;
        dbms_lob.createtemporary(v_clob, TRUE);
        
        FOR v IN (SELECT t.id, t.ad_client_id, t.ad_org_id, t.ownerid, t.prod_id,
                         t.name, t.basic_uom, t.orientation, t.status1, t.puc_mode,
                         t.prod_year, t.prod_season, t.for_season, t.series,
                         t.themedesign, t.prod_partm, t.prod_group, t.prod_sub_group,
                         t.old_brand_id, t.brand_id, t.prod_sorts, t.prod_line
                  FROM list_product t
                  WHERE t.ediflag = 80) LOOP
            BEGIN
            --业务逻辑
            
                --COMMIT;
            EXCEPTION
                WHEN OTHERS THEN
                    --ROLLBACK;
    v_log := SQLERRM; p_code := 1; v_strs := '-款号[' || v.prod_id || ']:' || v_log; dbms_lob.append(v_clob, v_strs); END; END LOOP; p_err_mesg := v_clob; dbms_lob.freetemporary(v_clob); END;

      

  • 相关阅读:
    CRLF注入
    Windows下消息中间件RabbitMQ安装教程(超详细)
    (超详细)SpringBoot+RabbitMQ+Stomp+JS实现前端消息推送
    数数塔 NBUT 1083
    数数塔 NBUT 1083
    数塔 HDU 2084
    数塔 HDU 2084
    数塔 HDU 2084
    递推
    递推
  • 原文地址:https://www.cnblogs.com/Jeffrey-xu/p/9947970.html
Copyright © 2020-2023  润新知