Subject | Re: [firebird-support] timestamp trigger? |
---|---|
Author | Marcos Vinicius Dufloth |
Post date | 2006-10-13T12:44:27Z |
Em Qui, 2006-10-12 às 15:11 -0700, Fernando Salaices escreveu:
into :MyTimeStampVar;
Marcos Vinicius.
[Non-text portions of this message have been removed]
> Hello everyone.the correct syntax is: select CURRENT_TIMESTAMP from RDB#DATABASE
>
> I need to have a timestamp that is updated every time a record is
> inserted or updated. I had asumed that just declaring the field as
> Timestamp this wold be acomplished but I was wrong. So a trigger
> (before update or insert) would be the next best thing. This is how I
> obtain the current date from firebird:
>
> select CURRENT_TIMESTAMP,
> from rdb$database;
>
> So I tried:
>
> select CURRENT_TIMESTAMP into NEW.MYTIMESTAMPFIELD,
> from rdb$database;
>
> did not work, so I tried:
>
> select CURRENT_TIMESTAMP into :NEW.MYTIMESTAMPFIELD,
> from rdb$database;
>
> Did not work either. So, can some one help me please? Is there another
> way to obtain an auto timestamp field?
>
into :MyTimeStampVar;
> Can a BEFORE UPDATE and a BEFORE UPDATE OR INSERT coexist? Because myyes. see also POSITION syntax for triggers.
> table already has a BEFORE INSERT trigger.
>
Marcos Vinicius.
[Non-text portions of this message have been removed]