Subject Re: [IBDI] Triggers problem on interbase 6.0
Author Helen Borrie (Team JEDI)
At 12:18 PM 11-09-00 +0200, Fabrice Vende wrote:


>Hello,
>
>Why that triggers doesn't work ?
>I would like to set the today Date in column ac_Datemodif after an update.
>
>CREATE TRIGGER ACTIONS_UPDATE FOR ACTIONS
>ACTIVE AFTER UPDATE POSITION 0
>as
>BEGIN
>UPDATE CONTACTFICHE
>SET C_DATEMODIF="NOW"
>WHERE old.ac_codecontact=c_code;
>new.ac_DATEMODIF="NOW";
>END
>
>The instruction, work :
>UPDATE CONTACTFICHE
>SET C_DATEMODIF="NOW"
>WHERE old.ac_codecontact=c_code;
>
>But not :
>new.ac_DATEMODIF="NOW";
>
>AC_datemodif value is always equal to NULL after update !

Fabrice,

You must set it in a BEFORE UPDATE trigger.

(After Update has no effect - it is for doing other tasks, upon other
tables, after the tables triggers are complete).

Cheers,
Helen






All for Open and Open for All
InterBase Developer Initiative · http://www.interbase2000.org
___________________________________________________
Project JEDI · http://delphi-jedi.org
___________________________________________________