【发布时间】:2017-07-10 18:55:54
【问题描述】:
当我传递一个输入参数时,我有一个存储过程。使用该输入参数,如果没有 no_data_found 那么我将引发异常,试图在该错误日志表中存储 no_data_found 错误,但我无法做到。请在下面找到我的代码,
存储过程:
create or replace procedure dumm_proc (p_opportunity_number cct_opportunity.opportunity_number%type)
as
v_oppo_id varchar2(50);
l_message varchar2(50) := sqlerrm;
l_code varchar2(50) := sqlcode;
begin
select opportunity_id into v_oppo_id
from cct_opportunity
where opportunity_number = p_opportunity_number;
exception
when no_data_found then
raise;
xxcct_error_logs(cct_error_seq.nextval,null,v_oppo_id,null,null,l_message,l_code,'dumm_proc',null,sysdate,user,sysdate,user);
when others then
xxcct_error_logs(cct_error_seq.nextval,null,v_oppo_id,null,null,l_message,l_code,'dumm_proc',null,sysdate,user,sysdate,user);
end;
使用另一个错误日志过程 (xxcct_error_logs) 将值存储到表中,但它总是在正常、成功完成的情况下存储。
请建议我如何通过调用 error_logs 过程来存储 no_data_found 错误。
【问题讨论】:
-
您好,欢迎来到 StackOverflow。请花一些时间阅读帮助页面,尤其是名为"What topics can I ask about here?" 和"What types of questions should I avoid asking?" 的部分。更重要的是,请阅读the Stack Overflow question checklist。您可能还想了解Minimal, Complete, and Verifiable Examples。