Subject Re: [firebird-support] After insert or after update trigger
Author Martijn Tonies
Oh, and one more thing...

> > Is there some way to create a trigger what works both after insert and
> > after update?
> > someting like:
> >
> > CREATE TRIGGER MyTrigger FOR MyTable AFTER INSERT OR AFTER UPDATE
> > POSITION 0 AS
> > BEGIN
> >
> > if (new.MyDateField='30.12.1899') then update MyTable set
> > MyDateField=null where ID=new.ID;
> >
> > END

Why don't you use a BEFORE trigger?

IF (new.MyDateField='30.12.1899')
then new.MyDAteField = NULL;

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com