Subject | Re: [ib-support] Mass deletion |
---|---|
Author | Doug Chamberlin |
Post date | 2002-04-10T14:59:48Z |
At 04/09/2002 05:28 PM (Tuesday), Nataraj S Narayanan wrote:
with old.* fields.
>On Tue, 9 Apr 2002, Doug Chamberlin wrote:You need to read the documentation on triggers!
> > 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?
> > P.S. It would help us help you if you said what type of trigger you haveIn that case it should be old.bill_id since the delete triggers only deal
> > created (before insert, after update, etc.) There can be small differences
> > between them.
>
>Well ,i had given the trigger as a 'before delete'.
with old.* fields.