procedure postProcessPO(po_batch_id varchar2)
is
begin
-- 1) ##origin_name
execute immediate
'
update SAP_DOMESTIC_INVOICE_PIPO_PIPO_EC t
set t."##origin_name" = xxmdg.mdgUtils.systemOriginInstance(t.system_mandant, ''' || xxwh_sap_domestic_invoice_pkg.LOAD_SOURCE || ''')
where t.ETL_TRANSFER_TRANSACTION_ID = :a
' using in po_batch_id;
-- 2) hash от уже обновлённого ##origin_name
execute immediate
'
update SAP_DOMESTIC_INVOICE_PIPO_PIPO_EC t
set t."hash" = cast(
rawtohex(
standard_hash(
t."##origin_name" || '' || '' || t."billingDocument" || '' || '' || t."billingDocumentItem",
''SHA256''
)
)
as varchar2(256 char)
)
where t.ETL_TRANSFER_TRANSACTION_ID = :a
' using in po_batch_id;
end postProcessPO;