Subject | Re: [ib-support] Mass deletion |
---|---|
Author | Nataraj S Narayanan |
Post date | 2002-04-09T19:21:40Z |
Hi
I tried dropping the Foreign key constraint. But no way. It just freezes
after some time.
Am trying out triggers and stored procedures as suggested by others in the
list.
I tried recreating the constraint with a ON DELETE CASACADE.
But somehow i am not getting the sytax right.
I gave something like
ALTER TABLE DRUG_BILL_ITEM ADD FORIEGN KEY (BILL_ID) REFERENCES DRUG_BILL
(BILL_ID) ON DELETE CASCADE
If i get it correct would it work ?
I tried dropping the Foreign key constraint. But no way. It just freezes
after some time.
Am trying out triggers and stored procedures as suggested by others in the
list.
I tried recreating the constraint with a ON DELETE CASACADE.
But somehow i am not getting the sytax right.
I gave something like
ALTER TABLE DRUG_BILL_ITEM ADD FORIEGN KEY (BILL_ID) REFERENCES DRUG_BILL
(BILL_ID) ON DELETE CASCADE
If i get it correct would it work ?
On Tue, 9 Apr 2002, Ann Harrison wrote:
> At 03:15 AM 4/9/2002 +0530, Nataraj S Narayanan wrote:
>
> >The Tables to delete data are Drug_Bill and Drug_Bill_Item ,where the 2nd
> >table has a foriegn key of Drug_Bill by name Bill_Id.
> >
> >As said by Helen I gave the command 'Delete from Drug_Bill_Item where
> >Bill_id in (select Bill_id from Drug_bill Where Bill_Date between
> >'01-JAN-1999' and '31-DEC-1999')
> >
> >Unfortunately, the operation takes aeons (7 hours) to complete.
>
> In this case, I suspect you'll have to drop the constraint to make
> the delete work in finite time. The problem is not that the constraint
> is being checked (why would it be?) but that the constraint causes
> the creation of an index that is a disaster for deletes. Recreate
> the constraint only after you have deleted the records and committed all
> active transactions.
>
> Regards,
>
> Ann
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
--
Nataraj S Narayanan
Synergy Info Systems
Kochi,India-683 503
Ph:95 484 557244