Subject Re: [ib-support] Mass deletion
Author Doug Chamberlin
At 04/09/2002 05:28 PM (Tuesday), Nataraj S Narayanan wrote:
>On Tue, 9 Apr 2002, Doug Chamberlin wrote:
> > Yes! Your delete statement does not reference the context of the trigger.
> > (That is done using the OLD.XXX or NEW.XXX pseudo records.) Therefore,
> your
> > delete statement is interpreted just as it would be if you issued it
> > independently. What you have said is, effectively:
> >
> > >delete drug_bill_item where bill_id=bill_id
> >
> > which would naturally delete all records where bill_id is not null.
> >
> > What you want is something like:
> >
> > delete drug_bill_item where drug_bill_item.bill_id=new.bill_id;
>
>Is it new.bill_id or old.bill_id?

You need to read the documentation on triggers!

> > P.S. It would help us help you if you said what type of trigger you have
> > created (before insert, after update, etc.) There can be small differences
> > between them.
>
>Well ,i had given the trigger as a 'before delete'.

In that case it should be old.bill_id since the delete triggers only deal
with old.* fields.