Untitled
raw download clone
TEXT
views 30
,
size 2553 b
BEGIN TRAN
UPDATE acuhistr 
SET rest_curr=cur_amount, rest_amount=amount 
WHERE voucher_no = '70111714' AND agrtid IN  (4283132, 4283133)
-- COMMIT if 2 rows affected, ROLLBACK if another number affected

INSERT INTO acutrans(account, amount, apar_id, apar_type, arrive_id,  
att_1_id, att_2_id, att_3_id, att_4_id, att_5_id, att_6_id, att_7_id,  
client, collect_agency, collect_ref, collect_status, commitment, compl_delay,  
complaint, cur_amount, curr_doc, curr_licence, currency, dc_flag, description,  
dim_1, dim_2, dim_3, dim_4, dim_5, dim_6, dim_7, disc_date, disc_percent,  
discount, due_date, exch_rate, ext_inv_ref, factor_short, int_date, int_status,  
intrule_id, kid, last_update, legal_status, order_id, pay_currency, pay_flag,  
pay_method, pay_plan_id, pay_transfer, payment_date, payperiod, period,  
rem_level, remind_date, remit_amount, remitt_curr, remitt_id, responsible,  
rest_amount, rest_curr, rest_value_2, rest_value_3, rev_date, rev_diff,  
rev_diff_v2, rev_diff_v3, sequence_no, status, tax_code, trans_date, trans_id,  
user_id, value_2, value_3, voucher_date, voucher_no, voucher_ref, voucher_type) 
SELECT  
account, amount, apar_id, apar_type, arrive_id, att_1_id, att_2_id,  
att_3_id, att_4_id, att_5_id, att_6_id, att_7_id, client, collect_agency,  
collect_ref, collect_status, commitment, compl_delay, complaint, cur_amount,  
curr_doc, curr_licence, currency, dc_flag, description, dim_1, dim_2, dim_3,  
dim_4, dim_5, dim_6, dim_7, disc_date, disc_percent, discount, due_date, exch_rate,  
ext_inv_ref, factor_short, int_date, int_status, intrule_id, kid, last_update,  
legal_status, order_id, pay_currency, pay_flag, pay_method, pay_plan_id, pay_transfer,  
payment_date, payperiod, period, rem_level, remind_date, remit_amount, remitt_curr,  
remitt_id, responsible, rest_amount, rest_curr, rest_value_2, rest_value_3, rev_date,  
rev_diff, rev_diff_v2, rev_diff_v3, sequence_no, status, tax_code, trans_date, trans_id, 
user_id, value_2, value_3, voucher_date, voucher_no, voucher_ref, voucher_type 
FROM acuhistr 
WHERE voucher_no = '70111714'  AND agrtid IN  (4283132, 4283133)



BEGIN TRAN
UPDATE acuhistr 
SET client = 'Z_L1'
WHERE voucher_no = '70111714'  AND agrtid IN  (4283132, 4283133)
--COMMIT if 2 rows affected, ROLLBACK if another number affected


BEGIN TRAN
UPDATE acumatch
SET client = 'Z_L1'
WHERE voucher_no = '70111714'  AND agrtid IN (2172533, 2172532, 2172531, 2172530)
--COMMIT if 4 rows affected, ROLLBACK if another number affected
close fullscreen
Login or Register to edit or fork this paste. It's free.