You can get the current time in sub-second resolution using the SYSTIMESTAMP function.
Caveats: The resolution of the time returned is system-dependent, but is generally at the microsecond level or better.
Store the Oracle Time in Microseconds:
CREATE TABLE mytable
(
TIMESTAMP(9) mydatetime,
VARCHAR2(30) mycomment
);
INSERT INTO mytable
VALUES (SYSTIMESTAMP, "This is the time that I ran the insert statement.");
In order to keep a SYSTIMESTAMP value in the database, you need to use the column type TIMESTAMP.
By default, the TIMESTAMP precision is 6 decimal places, but you can choose between 0 and 9.
Caveats: The resolution of the time returned is system-dependent, but is generally at the microsecond level or better.
See the Oracle Time in Microseconds:
SELECT TO_CHAR(SYSTIMESTAMP, 'DD-MM-YYYYHH24:MI:SSXFF')
FROM mytable;
In order to see a SYSTIMESTAMP/TIMESTAMP value, you can use the TO_CHAR function.
Format Models include ...
DD = Date (number).
MM = Month (number).
YYYY = Year (number).
HH24 = Hour (24 hour time).
MI = Minutes.
SS = Seconds (integral).
X = Radix character in local language.
FF = Fractional seconds (without radix).
FFN = Fractional seconds with N decimal places (without radix) where N must be between 1 and 9.
Caveats: The resolution of the time returned is system-dependent, but is generally at the microsecond level or better. If the resolution is microseconds and you try to print more than 6 decimal places, the places beyond the 6th will contain zeros.
Tags: oracle time in microseconds, time, microseconds, sub-second time, subsecond time, sub-second resolution, subsecond resolution, sub-second accuracy, subsecond accuracy, oracle database, oracle, database