Skip to content

Instantly share code, notes, and snippets.

@italoag
Created May 5, 2011 22:04
Show Gist options
  • Save italoag/958067 to your computer and use it in GitHub Desktop.
Save italoag/958067 to your computer and use it in GitHub Desktop.
Perola do Programador Peroba!
--
-- Caso o erro tenha sido de PK na TBL_CASPETA força o pedido para ser excluido no Mainframe
--
if instr(vc_msg_err,'ORA-00001: unique constraint (OW_DOCK.PK_INVC) violated') <> 0 then
vb_erro_pk_pedido := true; -- engana o programa indicando que o pedido foi ok
else
rollback to pedido;
end if;
commit; -- grava pedidos até o presente momento
vc_msg := 'Pedido (archv_nm='''||nvl(vr_invc.archv_nm,'N00000.PK')||''' and mrkt_cd_nr='||vr_invc.mrkt_cd_nr||' and julian_day_nr='||
lpad(vr_invc.julian_day_nr,3,'0')||' and ord_id_nr='||lpad(vr_invc.ord_id_nr,8,'0')||' and wrhs_id_nr='||
lpad(vr_invc.wrhs_id_nr,3,'0')||' and rep_nr='||lpad(vr_invc.rep_nr,5,'0')||' and rep_asc_nr='||
lpad(vr_invc.rep_asc_nr,3,'0')||' and bilng_dt='||to_char(vr_invc.bilng_dt, '''yyyy-mm-dd')||'''):'||vc_msg;
vc_msg := vc_msg || vc_msg_err;
--
if vc_log_hist_flag = 'S' then
sir_pc_job_cntrl.write_msg(vn_job_nr,vd_start,vc_msg);
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment