Tuesday, October 14, 2014

query for Delete Party FROM IBM MDM



delete from  IDENTIFIER where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  CONTRACTROLE  where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  CONTACTREL   where to_cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  CONTACTREL   where from_cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  ENTITYROLE where contxt_instance_pk  in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  ADDRESSGROUP where location_group_id in (select location_group_id from  LOCATIONGROUP where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000'));

delete from  CONTACTMETHODGROUP where location_group_id in (select location_group_id from  LOCATIONGROUP where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000'));


delete from  LOCATIONGROUP where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  PERSONSEARCH  where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  PERSONNAME  where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  XPERSON  where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  PERSON  where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  ORGNAME   where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  h_XORGANIZATION  where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');


delete from  XORGANIZATION  where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  ORG  where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  LOBREL where instance_pk in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  MISCVALUE where instance_pk in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');

delete from  XCONTEQUIV where  xcont_equiv_id in (select cont_equiv_id from  CONTEQUIV  where cont_id in (select cont_id from contact where created_dt >'22-NOV-13 00.57.54.705000000'));

delete from  CONTEQUIV where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');


--save grouping id first and then   from GROUPINGASSOC
--select * from GROUPINGASSOC where instance_pk in (select cont_id from contact where created_dt >'22-NOV-13 00.57.54.705000000');

--delete from GROUPINGASSOC where instance_pk in (select cont_id from contact where created_dt >'22-NOV-13 00.57.54.705000000');

--delete from XGROUPING where grouping_id in ();

--delete from GROUPING  where grouping_id in ();

delete from  BILLINGASSOC where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');


delete from  CONTACT where cont_id in (select cont_id from  contact where created_dt >'22-NOV-13 00.57.54.705000000');


No comments:

Post a Comment