Article View: borland.public.interbase.sql
Article #11119Re: Avoid recursive trigger
From: Emi Garcia
Date: Fri, 13 Dec 2002 11:36
Date: Fri, 13 Dec 2002 11:36
44 lines
2300 bytes
2300 bytes
I've asked before try... The update statement inside the trigger code do not fire the trigger.... Thanks. "Martijn Tonies" <m.tonies@upscene_remove.com> escribi๏ฟฝ en el mensaje news:3df5ed1f$1@newsgroups.borland.com... > Hi, > > > I need to made a trigger that updates a set of records when a record is > > updated. > > The problem is that the trigger only must run when the first update > > statement is executed. > > So you are updating the table that the trigger is on? Pff, the only way I > can think of is to update some dummy column to "UPDATE_BY_TRIGGER" > and in your trigger code do something like: > > if (new.mydummycolumn <> 'UPDATE_BY_TRIGGER') > then begin > // do my stuff > end > > > The update statements inside the body trigger must not fire the trigger. > > I try to alter trigger trigger to inactive in the first line of the tigger > > code but I get an error from interbase . > > Of course - it's DDL, which isn't allowed in procedures or triggers. > > > > -- > > With regards, > > Martijn Tonies > InterBase Workbench - the developer tool for InterBase & Firebird > Firebird Workbench - the developer tool for Firebird > Upscene Productions > http://www.upscene.com > > "This is an object-oriented system. > If we change anything, the users object." > >
Technical Details
Message-ID:
<3df9c695@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3df5e619@newsgroups.borland.com> <3df5ed1f$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 114a0e,744a7a3b4fe7b4d5 X-Google-Attributes: gid114a0e,public X-Google-ArrivalTime: 2002-12-13 03:39:32 PST From: "Emi Garcia" <noundo@telefonica.net> Newsgroups: borland.public.interbase.sql References: <3df5e619@newsgroups.borland.com> <3df5ed1f$1@newsgroups.borland.com> Subject: Re: Avoid recursive trigger Date: Fri, 13 Dec 2002 12:36:21 +0100 Lines: 46 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 80.34.168.185 Message-ID: <3df9c695@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1039779477 80.34.168.185 (13 Dec 2002 03:37:57 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail