Anda di halaman 1dari 3

---Shipment Header Interface

SELECT *

FROM apps.rcv_headers_interface

WHERE shipment_num IN ('21603832-1')

delete apps.rcv_headers_interface

WHERE shipment_num IN ('21603832-1')

---RCV Transactions Interface

SELECT *

FROM apps.rcv_transactions_interface

WHERE shipment_num IN ('21603832-1')

delete apps.rcv_transactions_interface

WHERE shipment_num IN ('21603832-1')

---RCV Shipment Headers

SELECT *

FROM apps.rcv_shipment_headers rsh

WHERE shipment_num IN ('21603832-1')

delete apps.rcv_shipment_headers rsh

WHERE shipment_num IN ('21603832-1')

---RCV Shipment Lines


SELECT *

FROM apps.rcv_shipment_lines

WHERE shipment_header_id IN (SELECT shipment_header_id

FROM apps.rcv_shipment_headers rsh

WHERE shipment_num IN ('21603832-1'))

delete apps.rcv_shipment_lines

WHERE shipment_header_id IN (SELECT shipment_header_id

FROM apps.rcv_shipment_headers rsh

WHERE shipment_num IN ('21603832-1'))

---RCV Transactions

SELECT *

FROM apps.rcv_Transactions

WHERE shipment_header_id IN (SELECT shipment_header_id

FROM apps.rcv_shipment_headers rsh

WHERE shipment_num IN ('21603832-1'))

----PO Line Locations

SELECT sum(quantity_shipped)

FROM apps.rcv_shipment_lines

WHERE shipment_header_id IN (SELECT shipment_header_id

FROM apps.rcv_shipment_headers rsh

WHERE shipment_num IN ('21603832-1'))


Select sum(quantity_shipped) from apps.po_line_locations_all

WHERE line_location_id IN (

SELECT po_line_location_id

FROM apps.rcv_shipment_lines

WHERE shipment_header_id IN (

SELECT shipment_header_id

FROM apps.rcv_shipment_headers rsh

WHERE shipment_num IN ('21603832-1')))

UPDATE apps.po_line_locations_all

SET quantity_shipped = NULL

WHERE line_location_id IN (

SELECT po_line_location_id

FROM apps.rcv_shipment_lines

WHERE shipment_header_id IN (

SELECT shipment_header_id

FROM apps.rcv_shipment_headers rsh

WHERE shipment_num IN ('21603832-1')))