Subject Re: [ib-support] Mass deletion
Author Ann Harrison
At 04:31 PM 4/9/2002 +0530, Nataraj S Narayanan wrote:

>Just created and tried a trigger in drug_bill. The following is the body
>of the trigger
>
>BEGIN
>
>delete drug_bill_item where drug_bill_item.bill_id=bill_id;
>
>END;
>
>The result is startling!! it empties the drug_bill_item table when i
>delete records in drug_bill.
>
>Something wrong with the trigger?

Yes. You need the alias "old" on the second bill_id.

delete drug_bill_item where drug_bill_item.bill_id = old.bill_id;


Without it, you've specified an identity and it will delete everything.

Regards,

Ann