The document contains SQL statements to:
1. Create new tables from existing interface tables for rejected purchase order records over 30 days old.
2. Delete the corresponding records from the original interface tables for rejected purchase orders over 30 days old.
3. The records are filtered by source code, process code, and creation date less than 30 days ago.
The document contains SQL statements to:
1. Create new tables from existing interface tables for rejected purchase order records over 30 days old.
2. Delete the corresponding records from the original interface tables for rejected purchase orders over 30 days old.
3. The records are filtered by source code, process code, and creation date less than 30 days ago.
The document contains SQL statements to:
1. Create new tables from existing interface tables for rejected purchase order records over 30 days old.
2. Delete the corresponding records from the original interface tables for rejected purchase orders over 30 days old.
3. The records are filtered by source code, process code, and creation date less than 30 days ago.
AS SELECT * FROM APPS.PO_HEADERS_INTERFACE WHERE INTERFACE_SOURCE_CODE = 'IC Automation' AND PROCESS_CODE = 'REJECTED' AND creation_date < SYSDATE - 30;
CREATE TABLE PO_LINES_IFACE_0204
AS SELECT * FROM APPS.PO_LINES_INTERFACE WHERE INTERFACE_HEADER_ID IN (SELECT INTERFACE_HEADER_ID FROM apps.po_headers_interface WHERE interface_source_code = 'IC Automation' AND process_code = 'REJECTED' AND creation_date < SYSDATE - 30);
CREATE TABLE PO_DIST_IFACE_0204
AS SELECT * FROM APPS.PO_DISTRIBUTIONS_INTERFACE WHERE INTERFACE_HEADER_ID IN (SELECT INTERFACE_HEADER_ID FROM apps.po_headers_interface WHERE interface_source_code = 'IC Automation' AND process_code = 'REJECTED' AND creation_date < SYSDATE - 30);
--Delete distributions Iface
DELETE FROM PO_DISTRIBUTIONS_INTERFACE WHERE INTERFACE_HEADER_ID IN (SELECT INTERFACE_HEADER_ID FROM apps.po_headers_interface WHERE INTERFACE_SOURCE_CODE = 'IC Automation' AND PROCESS_CODE = 'REJECTED' AND creation_date < SYSDATE - 30);
--Delete Lines Iface
DELETE FROM PO_LINES_INTERFACE WHERE INTERFACE_HEADER_ID IN (SELECT INTERFACE_HEADER_ID FROM apps.po_headers_interface WHERE INTERFACE_SOURCE_CODE = 'IC Automation' AND PROCESS_CODE = 'REJECTED' AND creation_date < SYSDATE - 30);
--Delete Headers Iface
DELETE FROM PO_HEADERS_INTERFACE WHERE INTERFACE_HEADER_ID IN (SELECT INTERFACE_HEADER_ID FROM apps.po_headers_interface WHERE INTERFACE_SOURCE_CODE = 'IC Automation' AND PROCESS_CODE = 'REJECTED' AND creation_date < SYSDATE - 30);