Subject Re: [IBO] IB_query default value property
Author mdberezaga
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> It is not a good idea to use the client-local (Delphi) date
variables for
> date/time stamping or for calculating derived values that are going
to be
> stored in the database. These variables in the client application
will
> record the date/time on the client machine, not the server. This
makes the
> stamping unreliable in a mult-user environment.
>
> The safe thing to do is to write Before Insert and Before Update
triggers
> on the table that is to get the timestamp. You still have access
to
> date/time variables, and they are local to the server. Here's an
example:
>
> CREATE TRIGGER TIMESTAMP_CUSTOMER FOR CUSTOMER
> ACTIVE BEFORE INSERT POSITION 0 AS
> [[[[ ACTIVE BEFORE UPDATE POSITION 0 AS ]]]]
> BEGIN
> NEW.DATE_STAMP = CURRENT_DATE;
> /* or, alternatively --- */
> [[[[ NEW.DATE_STAMP = CAST ('TODAY' AS DATE);]]]]
> END
>
> Helen

Helen,

When I set IB_Query.GetServerDefaults, and default on database field
is CURRENT_DAY, IBO will get the date value on the server, that's
right?

Thanks.