PLS-00222此范围内不存在名称为“WRITE_ERROR_LOG”的函数

时间:2015-09-18 21:22:43

标签: oracle stored-procedures plsql error-handling

刚刚完成编写错误日志过程,将错误记录到表中。我刚刚完成了我的第一个异常处理程序,由于此错误,我无法编译包。

我相信当我调用write_error_log过程时会出现此错误。 下面是包中的代码。

CREATE OR REPLACE PACKAGE BODY AOMS.customer IS

    PROCEDURE 
customer_collateral_hist(i_Vcust_cd   IN  customer_collateral_history.cust_cd%TYPE,
                                   i_Vfromdate  IN customer_collateral_history.reg_dttm%TYPE,
                                   i_Vtodate    IN customer_collateral_history.reg_dttm%TYPE,
                                   i_Vauthstat  IN customer_collateral_history.auth_stat%TYPE,
                                   o_Cresultset OUT SYS_REFCURSOR)
   AS
        v_in_out_parm VARCHAR2(4000) := NULL;

 BEGIN
     OPEN o_Cresultset FOR
     SELECT auth_stat,
            buld_size,
            clos_dt,
            cnfm_dt,
            cnfm_tm,
            cnfm_user_id,
            cust_cd,
            date_seq,
            dbtr,
            dbtr_addr,
            dbtr_id,
            dbtr_tel_no,
            dbtr_zip_cd1,
            dbtr_zip_cd2,
            esta_orga,
            grnt_dt_from,
            grnt_dt_to,
            jdg_amt,
            jdg_dt,
            land_size,
            loc_addr,
            mort_amt,
            mort_chng_dt,
            mort_flag,
            mort_max_amt,
            mort_seq,
            mort_stat,
            old_key,
            ownr,
            ownr_addr,
            ownr_id,
            ownr_tel_no,
            ownr_zip_cd1,
            ownr_zip_cd2,
            prev_mort_amt,
            redm_dt,
            reg_dt,
            reg_dttm,
            reg_flag,
            reg_user_id,
            remark,
            supr_pow_flag
       FROM customer_collateral_history
      WHERE cust_cd LIKE '%'||NVL(i_Vcust_cd, cust_cd)||'%'
        AND TO_NUMBER(SUBSTR(reg_dttm, 1, 8)) >= NVL(i_Vfromdate,   TO_NUMBER(SUBSTR(reg_dttm, 1, 8)))
    AND TO_NUMBER(SUBSTR(reg_dttm, 1, 8)) <= NVL(i_Vtodate, TO_NUMBER(SUBSTR(reg_dttm, 1, 8)))
    AND auth_stat LIKE '%'||NVL(i_Vauthstat, auth_stat)||'%';
  EXCEPTION
WHEN OTHERS THEN

  V_IN_OUT_PARM :=  'vcust_cd: '||i_vcust_cd||'fromdate:' ||i_vfromdate|| 'vtodate:' ||i_vtodate|| 'authstat:' || i_vauthstat||

   write_error_log(SQLERRM,dbms_utility.format_error_backtrace,V_IN_OUT_PARM);
   -- if you want to halt execution re-raise the error up the stack
   RAISE;
 END customer_collateral_hist;

END customer;
/

有没有人知道造成这种情况的原因。 write_error_log是一个存储过程。如果有更多信息,我可以提供给任何人让我知道。

1 个答案:

答案 0 :(得分:3)

我认为错误就在这一行:

V_IN_OUT_PARM :=  'vcust_cd: '||i_vcust_cd||'fromdate:' ||i_vfromdate|| 'vtodate:' ||i_vtodate|| 'authstat:' || i_vauthstat||

似乎意外地结束了。你需要连接到V_IN_OUT_PARAM或者最后||;还需要其他东西吗?

因为您已使用||结束了它,所以它会向Oracle查找,就好像您要将调用write_error_log的结果连接到此字符串一样。当然,你不能这样做,因为你没有一个名为write_error_log的函数。