Subject | Re: [firebird-support] After insert or after update trigger |
---|---|
Author | Martijn Tonies |
Post date | 2004-06-11T06:48:30Z |
Oh, and one more thing...
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
> > Is there some way to create a trigger what works both after insert andWhy don't you use a BEFORE trigger?
> > 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
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