2
votes

I have created table in oracle and tried to insert fractional seconds precision 9 as one of the row eg.

insert into t values(to_timestamp('2011-07-08 10:02:02.999999777','yyyy-mm-dd hh24:mi:ss.FF9'));

it works.. but when I try to use current_timestamp

insert into t values(current_timestamp(9));

08-JUL-11 04.06.58.603824000 PM. It only provides precision to 6 level. Is there any way to use 9 digit precision using oracle function. And side by side can java insert same level of precision?

1
You are using the Oracle function properly. The example you show is actually returning the precision to 9 decimals, but the last three numbers are just zeros. Are you getting the same behavior every time you use the current_timestamp function? - Aaron Ray
The level of precision you get time is likely to be different on different systems. - Peter Lawrey
Aaron, i am getting only microseconds level precision with 10,000 rows insert, that conforms my system windows 7 32 bit only supports microsecond precision as answered by Justin. thank you all for the help - Baha

1 Answers

2
votes

Oracle relies on the operating system clock and different operating systems provide different levels of fractional second precision. Most Unix operating systems provide 6 digits of subsecond precision (microseconds). Windows generally only provides 3 (milliseconds). Oracle can only get 9 digits of precision (nanoseconds) if the underlying operating system clock has that level of accuracy. And there aren't many operating systems on the market that provide that level of accuracy.