Subject RE: [ib-support] About default values
Author Kaputnik
>
>
> At 12/17/2001 02:57 PM (Monday), Kaputnik wrote:
> >before insert:
> >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
>
> Just two comments on what Nick 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
>
> > new.SYS$CHANGED_AT='NOW';
> > new.SYS$CREATED_AT=new.SYS$CHANGED_AT;
>
> That way the NOW function will have no chance of returning two slightly
> different values.
>
Of course.....in some cases, when the server is under high load, the two
values might actually really differ, but in my case it didn't matter yet.
Might change this in the future....

> 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.
>
Well, err, what advantages does this have except of having the opportunity
to type more? :-)

Cu, Nick