Tuesday, 1 November 2011

Receipt_Delete_Qry

/* Formatted on 20-08-2011 14:12:14 (QP5 v5.115.810.9015) */
DELETE FROM   rcv_shipment_headers
      WHERE   SHIPMENT_HEADER_ID IN
                    (  SELECT   rsh.SHIPMENT_HEADER_ID
                         FROM   rcv_shipment_headers rsh,
                                org_organization_definitions ood,
                                rcv_shipment_lines rsl
                        WHERE   SHIP_TO_ORG_ID = 129
                                AND ood.ORGANIZATION_ID = SHIP_TO_ORG_ID
                                AND rsl.SHIPMENT_HEADER_ID(+) =
                                      rsh.SHIPMENT_HEADER_ID
                                AND rsl.SHIPMENT_LINE_ID IS NULL
                     ORDER BY   receipt_num, rsh.SHIPMENT_HEADER_ID)
  

No comments:

Post a Comment