Subject | RE: [ib-support] About default values |
---|---|
Author | Doug Chamberlin |
Post date | 2001-12-17T20:02:15Z |
At 12/17/2001 02:57 PM (Monday), Kaputnik wrote:
1) If it is important to have the SYS$CHANGED_AT and SYS$CREATED_AT values
precisely the same after an insert, you might want to change the above to
different values.
2) The latest FB and IB versions provide CURRENT_TIMESTAMP in place of
'NOW'. I think this is a big improvement so I like to point it out.
>before insert:Just two comments on what Nick wrote.
>BEGIN
> IF (new.id IS NULL) THEN new.id=GEN_ID(GEN_something,1); //this is a
>tribute to IBO and its generatorlinks....
> new.SYS$CHANGED_AT='NOW';
> new.SYS$CREATED_AT='NOW';
> new.SYS$CHANGED_BY=CURRENT_USER;
> new.SYS$CREATED_BY=CURRENT_USER;
>END
1) If it is important to have the SYS$CHANGED_AT and SYS$CREATED_AT values
precisely the same after an insert, you might want to change the above to
> new.SYS$CHANGED_AT='NOW';That way the NOW function will have no chance of returning two slightly
> new.SYS$CREATED_AT=new.SYS$CHANGED_AT;
different values.
2) The latest FB and IB versions provide CURRENT_TIMESTAMP in place of
'NOW'. I think this is a big improvement so I like to point it out.