Oracle详细错误信息可以精确到哪一行(dbms_utility.format_error_backtrace)

以下案例:第7行会报no_data_found 错误 

 

declare
  x_out_mesg varchar2(2000);
  v_api_name varchar2(200); --程序名称
  v_head_id  number;
begin

  select pha.po_header_id
    into v_head_id
    from po_headers_all pha
   where pha.po_header_id = 7881234567;

exception
  when others then
    x_out_mesg := v_api_name || ': ' || dbms_utility.format_error_stack || ' ' ||
                  dbms_utility.format_error_backtrace || ',' || sqlerrm;
  
    dbms_output.put_line(x_out_mesg);
end;
View Code

 

 

posted @ 2024-04-08 15:58  Iven_lin  阅读(70)  评论(0)    收藏  举报