Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.
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
|Please help for the below sql query.||1||24|
|Include a logo in email body using Oracle utl_mail||11||30|
|Why i am getting a star, SSMS does not show me any error. Division Error||5||20|
|SQL Query assistance||16||20|