SELECT
l.CUSTOMER_PO_NUMBER
l.GLOBAL_ATTRIBUTE2
FROM
oe_headers_iface_all h,
oe_lines_iface_all l
WHERE
h.CUSTOMER_PO_NUMBER =l.CUSTOMER_PO_NUMBER
AND h.sold_to_org_id ='1296' --Customer_id of customer
AND l.GLOBAL_ATTRIBUTE2 IN('0078742087306','0078742088341') ;
--+++++++++++++++++++++++++++++++
--For delete lines
DELETE
FROM
oe_lines_iface_all
WHERE
CUSTOMER_PO_NUMBER IN
(
SELECT
l.CUSTOMER_PO_NUMBER
FROM
oe_headers_iface_all h,
oe_lines_iface_all l
WHERE
h.CUSTOMER_PO_NUMBER =l.CUSTOMER_PO_NUMBER
AND h.sold_to_org_id ='1296'
)
AND GLOBAL_ATTRIBUTE2 IN('0078742087306','0078742088341') ; --place locations which are deleted.
l.CUSTOMER_PO_NUMBER
l.GLOBAL_ATTRIBUTE2
FROM
oe_headers_iface_all h,
oe_lines_iface_all l
WHERE
h.CUSTOMER_PO_NUMBER =l.CUSTOMER_PO_NUMBER
AND h.sold_to_org_id ='1296' --Customer_id of customer
AND l.GLOBAL_ATTRIBUTE2 IN('0078742087306','0078742088341') ;
--+++++++++++++++++++++++++++++++
--For delete lines
DELETE
FROM
oe_lines_iface_all
WHERE
CUSTOMER_PO_NUMBER IN
(
SELECT
l.CUSTOMER_PO_NUMBER
FROM
oe_headers_iface_all h,
oe_lines_iface_all l
WHERE
h.CUSTOMER_PO_NUMBER =l.CUSTOMER_PO_NUMBER
AND h.sold_to_org_id ='1296'
)
AND GLOBAL_ATTRIBUTE2 IN('0078742087306','0078742088341') ; --place locations which are deleted.
No comments:
Post a Comment