Subject | Re: [firebird-support] Server Date and time |
---|---|
Author | Thomas Steinmaurer |
Post date | 2007-03-21T21:01:08Z |
Hi,
Use a DEFAULT declaration at field level which will be used when the
field is omitted in field list of an INSERT INTO statement.
Are you using MySQL or is your server simple called MySql? ;-)
For instance:
INSERT INTO (datetimecolumn) values (CURRENT_TIMESTAMP)
or
UPDATE ... SET datetimecolumn = CURRENT_TIMESTAMP WHERE ...
--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com
> I have a client-server application and would like to add a new featureYes, but not necessarily in case of an INSERT INTO statement.
> that requires the following procedure:
>
> When a client click a button, the server (MySql) generates a new
> record in the database and updates the field ACTUAL_DATE with the
> server's date and time (NOT the client's). Do I have to use
> triggers/stored procedures?
Use a DEFAULT declaration at field level which will be used when the
field is omitted in field list of an INSERT INTO statement.
Are you using MySQL or is your server simple called MySql? ;-)
> Note that there is a possibility that the client receive the server'sUse CURRENT_TIMESTAMP for getting the server's date/time.
> Date and Time before creation of the new record, and then he (client)
> send an SQL creating and updating the field. In this case is it
> possible to write an SQL expression requiring the server date and time?
For instance:
INSERT INTO (datetimecolumn) values (CURRENT_TIMESTAMP)
or
UPDATE ... SET datetimecolumn = CURRENT_TIMESTAMP WHERE ...
--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com