Вы находитесь на странице: 1из 2

.The datafix script for PO:1000100002856 is as follows.

Kindly execute the data fix


script in a test instance first

/* Datafix script for PO 1000100002856 */


/* please backup correspond data before exeucte scripts,
/* kindly perform in test environment before exeucte in product env*/

-- 1. backup related records


CREATE TABLE bkp_pod_1000100002856
AS select * from po_distributions_all
WHERE po_distribution_id=14199;

CREATE TABLE bkp_pol_1000100002856


AS select * from po_line_locations_all
WHERE line_location_id=21479;

CREATE TABLE bkp_rsl_1000100002856


AS select * from rcv_shipment_lines
WHERE shipment_line_id IN (9005,9006);

CREATE TABLE bkp_rt_1000100002856


AS select * from rcv_transactions
WHERE transaction_id IN (23955,23956,23957,23958);

-- 2. execute the following sql to correct

UPDATE po_distributions_all
SET amount_delivered = 44178.27,
last_update_date = sysdate
WHERE po_distribution_id=14199;

UPDATE po_line_locations_all
SET amount_received = 44178.27,
AMOUNT_SHIPPED = 0,
last_update_date = sysdate
WHERE line_location_id=21479;

UPDATE rcv_shipment_lines
SET AMOUNT_RECEIVED = 23411.01,
last_update_date = sysdate
WHERE shipment_line_id= 9005;

UPDATE rcv_shipment_lines
SET AMOUNT_RECEIVED = 2234.7,
last_update_date = sysdate
WHERE shipment_line_id= 9006;

UPDATE rcv_transactions
SET po_line_location_id=-1*po_line_location_id,
po_distribution_id=-1*po_distribution_id,
last_update_date = sysdate
WHERE transaction_id IN (23955,23956,23957,23958);

-- 3. Verify the result and run commit


commit;

Вам также может понравиться