0
点赞
收藏
分享

微信扫一扫

写oracle存储过程时,方便知道出错在哪一行

芥子书屋 2023-04-11 阅读 128

create or replace procedure pro_order_info_update as
 
 begin
 
 declare
 
 v_line_num varchar2(10);
 
begin
 
 v_line_num:='[1-1-1]';
 
 update svc_order_info_bak t set t.rec_dept=123 where t.order_id='425';
 
v_line_num:='[1-1-2]';
 
 update svc_order_info_bak t set t.AMOUNT='sdf' where t.order_id='425';
 
--v_line_num:='[1-1-3]';
 
 -- code 3;
 
--v_line_num:='[1-1-4]';
 
 -- code 4;
 
commit;
 
exception when others then 
 
 rollback;
 
 dbms_output.put_line('error on:'||v_line_num||', message:'||SQLCODE||','||sqlerrm);
 end;




end pro_order_info_update;

举报

相关推荐

0 条评论