//SQL脚本
declare
begin
update ra_interface_lines_all iall
set iall.conversion_type = substr(iall.conversion_type,1,9);
commit;
update ra_interface_lines_all iall
set iall.orig_system_bill_customer_ref = (select a.customer_id
from ar_customers_v a
where a.customer_name = iall.orig_system_bill_customer_ref
),
iall.orig_system_bill_address_ref = (select b.address_id
from ar_customers_v a ,ar_addresses_v b
where a.customer_name = iall.orig_system_bill_customer_ref
and a.customer_id = b.customer_id
);
update ra_interface_lines_all t
set t.interface_line_context = '外部导入',
t.interface_line_attribute1 = 'INTERFACE',
t.interface_line_attribute2 = t.trx_number,
t.interface_line_attribute3 = t.line_number,
t.amount = t.quantity * t.unit_selling_price,
t.memo_line_name = t.description,
t.conversion_date = gl_date,
t.org_id = 81;
update ra_interface_lines_all uila
set uila.conversion_type = 'User',
uila.conversion_date = uila.gl_date,
uila.conversion_rate = 1
where uila.currency_code = 'CNY';
commit;
exception
when others then
rollback;
end;
/
exit;
文章来源于领测软件测试网 https://www.ltesting.net/