Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW CAN I STORE TIME VALUES ???

Status
Not open for further replies.

PierreSmirnoff

Programmer
Aug 24, 2001
2
GB
Hi! I'm working on Oracle Formula1 database and need to store TIME values with a high precision.
The required format has to be like
1:47:22:561
Can't use varchar2 for it, because these time values must be use in SPEED calculations.

Any help would be appreciated. Thanx
 

What about separating the columns for each time elements and make it number type?

YOUR_TABLE
...
Hour_part NUMBER
Min_part NUMBER
Seconds_part NUMBER
Milliseconds_part NUMBER


 
you could store the milliseconds in an integer field Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Thank U guys!
The idea to store values in a separate fields is good, but I've got to store many attributes in that format, so the table would become huge.
I thought there was some kind of already predefined data type to store the TIME with a very high precision.
I can't believe Oracle developers did't think about that.
Anyway, I'll try to separate fields if nothing else is possible to do about that.

Thanx for your help.
 
I think Mike has the best approach here - store the milliseconds as an integer. Of course, you'll have to run computations to get the time back out in the format that you want, but a stored function might make that a bit less painful!
(Nice to see you again, Mike!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top