Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.
procedure DEL_SHIPMENTS_CUSTOMER(cust_id_in number) is cnt NUMBER; begin cnt := 0; for rec in ( select sc.shipment_id from SHIPMENT_CUSTOMER sc inner join CUSTOMER_MOT mt on mt.customer_mot_id = sc.customer_mot_id where mt.customer_id = cust_id_in ) loop delete from SHIPMENT sh where sh.shipment_id = rec.shipment_id; cnt := cnt + 1; if (cnt = 1000) THEN commit; cnt := 0; end if; end loop; commit; end; procedure DEL_CUSTOMER(cust_id_in number) is begin UPDATE CUSTOMER cu SET MARK_FOR_DELETION = 'P' WHERE cu.customer_id = cust_id_in; commit; DEL_SHIPMENTS_CUSTOMER(cust_id_in); DELETE FROM RULE WHERE CUSTOMER_ID = cust_id_in; DELETE FROM MOT_RULE WHERE CUSTOMER_ID = cust_id_in; DELETE FROM ACCOUNT WHERE CUSTOMER_ID = cust_id_in; DELETE FROM CUSTOMER_STATION WHERE CUSTOMER_ID = cust_id_in; DELETE FROM CUSTOMER WHERE CUSTOMER_ID = cust_id_in; commit; end; begin -- Initialization null; end MAINTAIN_CUSTOMER;
Error at line 3 ORA-02292: integrity constraint (XM.C_REPORT_LINKS_REPORT_ID_FK) violated - child record found ORA-06512: at "XM.MAINTAIN_CUSTOMER", line 34 ORA-06512: at line 5
|Is it possible to CONTINUE a loop from an exception in oracle pl/sql?||7||44|
|Oracle - Stored Procedure Privilge access||3||23|
|Maintaining Oracle Managed Accounts||2||21|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
13 Experts available now in Live!