Datetime data type
Posted in 2007
Topics: Data Types & Schema Design
Hi,
I have a table with the following structure:
create table perf(id integer,ct datetime year to fraction(3) default currentyear to fraction(3));
When I run the following command
insert into perf (id) values (1) the ct column is provided with the currentdatetime. However, when I run : select * from perf, I get this result
1 2007-10-11 11:00:44.000
The fraction part of the ct column is always 000.
Is there a way to have the database server insert the exact value
for example 2007-10-11 11:00:44.178 rather than 2007-10-11 11:00:44.000
Thanks
Yes. Enable sub-second timing in the server by setting:
USEOSTIME 1in your ONCONFIG file and bounce the engine instance. There used to be
overhead to turning this on so it's a configurable and not the default.
Current OS's have a very light weight implementation of gettimeofday() which is
what the engine uses to get the time if USEOSTIME is enabled.
Art S. Kagel
----- Original Message -----
From: Georges Martin <ids@iiug.org>
To: ids@iiug.org
At: 10/11 11:08:19
Hi,
I have a table with the following structure:
create table perf(id integer,ct datetime year to fraction(3) default currentyear to fraction(3));
When I run the following command
insert into perf (id) values (1) the ct column is provided with the currentdatetime. However, when I run : select * from perf, I get this result
1 2007-10-11 11:00:44.000
The fraction part of the ct column is always 000.
Is there a way to have the database server insert the exact value
for example 2007-10-11 11:00:44.178 rather than 2007-10-11 11:00:44.000
Thanks
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.