How to get Current Timestamp past seconds.
Posted in 2011
Topics: Platform-Specific Issues
OS Level: AIX 5.3.0.0
IDS ver.: 10.00.UC5
What SQL built-in function can I use to get the nano-seconds? The ones
below just go out to the seconds digits. I need the .000 filled in.
select current, current timestamp, current year to second, current time
from flags_text:
(expression) 2011-01-04 12:10:24.000
timestamp 2011-01-04 12:10:24.000
(expression) 2011-01-04 12:10:24
time 2011-01-04 12:10:24.000
Thanks,
*******************************************************************
Ernie Knox
IT Database Administrator Specialist
Sears Holdings - BU: I & T Group
3333 Beverly Rd., B4-266A
Hoffman Estates, IL. 60179
Office: (847) 286-5735
Email: Ernest.Knox@searshc.com
Blackberry: 2244650553@messaging.sprintpcs.com
<mailto:2244650553@messaging.sprintpcs.com>
Page via Skytel: 2244650553@sprint.skytel.com
<mailto:2244650553@sprint.skytel.com>
Informix or MySQL Primary: 9110210@skytel.com
<mailto:9110210@skytel.com>
Informix or MySQL Secondary: 7276872@skytel.com
<mailto:7276872@skytel.com>
" Yes we can make a Change! "
" It's always a great day to watch Sports - GO LIONS, TIGERS, and BEARS!
"
" Lets not forget - GO Pistons and Red Wings! "
GSU
*******************************************************************
You have to set USEOSTIME to '1' in the ONCONFIG file and bounce the engine,
then CURRENT YEAR TO FRACTION(5) will return time to the nearest 10 ns
(asuming the OS will support that fine a resolution) which is as close as
you can get. IB that AIX returns time to the nearest 300ns. I have a test
application in C that will print the finest time the OS can display in a
loop. Attached.
It's old, and I just tried it on Linux again and it failed, but I'll look at
it and send an update if I can figure that out. But I did have it working
on AIX once upon a time. The problem may be 32bit -vs- 64bit problems. BB
was all 32bit back then.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Tue, Jan 4, 2011 at 12:06 PM, Knox, Ernest <Ernest.Knox@searshc.com>wrote:
> OS Level: AIX 5.3.0.0
>
> IDS ver.: 10.00.UC5
>
> What SQL built-in function can I use to get the nano-seconds? The ones
> below just go out to the seconds digits. I need the .000 filled in.
>
> select current, current timestamp, current year to second, current time
> from flags_text:>
> (expression) 2011-01-04 12:10:24.000
>
> timestamp 2011-01-04 12:10:24.000
>
> (expression) 2011-01-04 12:10:24
>
> time 2011-01-04 12:10:24.000
>
> Thanks,
>
> *******************************************************************
>
> Ernie Knox
>
> IT Database Administrator Specialist
>
> Sears Holdings - BU: I & T Group
>
> 3333 Beverly Rd., B4-266A
>
> Hoffman Estates, IL. 60179
>
> Office: (847) 286-5735
>
> Email: Ernest.Knox@searshc.com
>
> Blackberry: 2244650553@messaging.sprintpcs.com
> <mailto:2244650553@messaging.sprintpcs.com>
>
> Page via Skytel: 2244650553@sprint.skytel.com
> <mailto:2244650553@sprint.skytel.com>
>
> Informix or MySQL Primary: 9110210@skytel.com
> <mailto:9110210@skytel.com>
>
> Informix or MySQL Secondary: 7276872@skytel.com
> <mailto:7276872@skytel.com>
>
> " Yes we can make a Change! "
>
> " It's always a great day to watch Sports - GO LIONS, TIGERS, and BEARS!
> "
>
> " Lets not forget - GO Pistons and Red Wings! "
>
> GSU
>
> *******************************************************************
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--001636c5b15b89cff604990885b1
Great Thanks.
Thanks,
*******************************************************************
Ernie Knox
IT Database Administrator Specialist
Sears Holdings - BU: I & T Group
3333 Beverly Rd., B4-266A
Hoffman Estates, IL. 60179
Office: (847) 286-5735
Email: Ernest.Knox@searshc.com
Blackberry: 2244650553@messaging.sprintpcs.com
Page via Skytel: 2244650553@sprint.skytel.com
Informix or MySQL Primary: 9110210@skytel.com
Informix or MySQL Secondary: 7276872@skytel.com
" Yes we can make a Change! "
" It's always a great day to watch Sports - GO LIONS, TIGERS, and BEARS!
"
" Lets not forget - GO Pistons and Red Wings! "
GSU
*******************************************************************
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
Art Kagel
Sent: Tuesday, January 04, 2011 12:23 PM
To: ids@iiug.org
Subject: Re: How to get Current Timestamp past seconds. [22337]
You have to set USEOSTIME to '1' in the ONCONFIG file and bounce the
engine,
then CURRENT YEAR TO FRACTION(5) will return time to the nearest 10 ns
(asuming the OS will support that fine a resolution) which is as close
as
you can get. IB that AIX returns time to the nearest 300ns. I have a
test
application in C that will print the finest time the OS can display in a
loop. Attached.
It's old, and I just tried it on Linux again and it failed, but I'll
look at
it and send an update if I can figure that out. But I did have it
working
on AIX once upon a time. The problem may be 32bit -vs- 64bit problems.
BB
was all 32bit back then.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other
organization with which I am associated either explicitly, implicitly,
or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Tue, Jan 4, 2011 at 12:06 PM, Knox, Ernest
<Ernest.Knox@searshc.com>wrote:
> OS Level: AIX 5.3.0.0
>
> IDS ver.: 10.00.UC5
>
> What SQL built-in function can I use to get the nano-seconds? The ones
> below just go out to the seconds digits. I need the .000 filled in.
>
> select current, current timestamp, current year to second, currenttime
> from flags_text:
>
> (expression) 2011-01-04 12:10:24.000
>
> timestamp 2011-01-04 12:10:24.000
>
> (expression) 2011-01-04 12:10:24
>
> time 2011-01-04 12:10:24.000
>
> Thanks,
>
> *******************************************************************
>
> Ernie Knox
>
> IT Database Administrator Specialist
>
> Sears Holdings - BU: I & T Group
>
> 3333 Beverly Rd., B4-266A
>
> Hoffman Estates, IL. 60179
>
> Office: (847) 286-5735
>
> Email: Ernest.Knox@searshc.com
>
> Blackberry: 2244650553@messaging.sprintpcs.com
> <mailto:2244650553@messaging.sprintpcs.com>
>
> Page via Skytel: 2244650553@sprint.skytel.com
> <mailto:2244650553@sprint.skytel.com>
>
> Informix or MySQL Primary: 9110210@skytel.com
> <mailto:9110210@skytel.com>
>
> Informix or MySQL Secondary: 7276872@skytel.com
> <mailto:7276872@skytel.com>
>
> " Yes we can make a Change! "
>
> " It's always a great day to watch Sports - GO LIONS, TIGERS, and
BEARS!
> "
>
> " Lets not forget - GO Pistons and Red Wings! "
>
> GSU
>
> *******************************************************************
>
>
>
>
************************************************************************
*******
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--001636c5b15b89cff604990885b1
************************************************************************
*******
Forum Note: Use "Reply" to post a response in the discussion forum.
Regards.
You could use the fraction(3), ex:
select unique(current year to fraction(3)) from [table];
Best regards.
Em 04/01/2011 13:06, Knox, Ernest escreveu:
> OS Level: AIX 5.3.0.0
>
> IDS ver.: 10.00.UC5
>
> What SQL built-in function can I use to get the nano-seconds? The ones
> below just go out to the seconds digits. I need the .000 filled in.
>
> select current, current timestamp, current year to second, current time
> from flags_text:>
> (expression) 2011-01-04 12:10:24.000
>
> timestamp 2011-01-04 12:10:24.000
>
> (expression) 2011-01-04 12:10:24
>
> time 2011-01-04 12:10:24.000
>
> Thanks,
>
> *******************************************************************
>
> Ernie Knox
>
> IT Database Administrator Specialist
>
> Sears Holdings - BU: I& T Group
>
> 3333 Beverly Rd., B4-266A
>
> Hoffman Estates, IL. 60179
>
> Office: (847) 286-5735
>
> Email: Ernest.Knox@searshc.com
>
> Blackberry: 2244650553@messaging.sprintpcs.com
> <mailto:2244650553@messaging.sprintpcs.com>
>
> Page via Skytel: 2244650553@sprint.skytel.com
> <mailto:2244650553@sprint.skytel.com>
>
> Informix or MySQL Primary: 9110210@skytel.com
> <mailto:9110210@skytel.com>
>
> Informix or MySQL Secondary: 7276872@skytel.com
> <mailto:7276872@skytel.com>
>
> " Yes we can make a Change! "
>
> " It's always a great day to watch Sports - GO LIONS, TIGERS, and BEARS!
> "
>
> " Lets not forget - GO Pistons and Red Wings! "
>
> GSU
>
> *******************************************************************
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Alexandre Marini
Tecnologia da Informação - DBA
msn: alexandre_marini@hotmail.com
SEFAZ-MS / SGI-UGSR / Sistemas IBM-Informix
Cert-Info-Mgmt_color <Cert-Info-Mgmt_color.jpg>
IBM Certified System Administrator - Informix Dynamic Server V10 / V11
You need to activate the parameter USEOSTIME in your onconfig file ad
rebounce your engine.
You can go up to 5 digits after the decimal point. By default you can
have up to 3 digits of precision.
Khaled BENTEBAL
khaled.bentebal@consult-ix.fr
Le 04/01/11 18:06, Knox, Ernest a écrit :
> OS Level: AIX 5.3.0.0
>
> IDS ver.: 10.00.UC5
>
> What SQL built-in function can I use to get the nano-seconds? The ones
> below just go out to the seconds digits. I need the .000 filled in.
>
> select current, current timestamp, current year to second, current time
> from flags_text:>
> (expression) 2011-01-04 12:10:24.000
>
> timestamp 2011-01-04 12:10:24.000
>
> (expression) 2011-01-04 12:10:24
>
> time 2011-01-04 12:10:24.000
>
> Thanks,
>
> *******************************************************************
>
> Ernie Knox
>
> IT Database Administrator Specialist
>
> Sears Holdings - BU: I& T Group
>
> 3333 Beverly Rd., B4-266A
>
> Hoffman Estates, IL. 60179
>
> Office: (847) 286-5735
>
> Email: Ernest.Knox@searshc.com
>
> Blackberry: 2244650553@messaging.sprintpcs.com
> <mailto:2244650553@messaging.sprintpcs.com>
>
> Page via Skytel: 2244650553@sprint.skytel.com
> <mailto:2244650553@sprint.skytel.com>
>
> Informix or MySQL Primary: 9110210@skytel.com
> <mailto:9110210@skytel.com>
>
> Informix or MySQL Secondary: 7276872@skytel.com
> <mailto:7276872@skytel.com>
>
> " Yes we can make a Change! "
>
> " It's always a great day to watch Sports - GO LIONS, TIGERS, and BEARS!
> "
>
> " Lets not forget - GO Pistons and Red Wings! "
>
> GSU
>
> *******************************************************************
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>