Oracle Time in Microseconds
This page answers questions like these:
- How to get the time in microseconds?
- How to get the time down to microseconds?
- How to get the time in nanoseconds?
- How to get the time down to nanoseconds?
Related Links:
Oracle Date and/or Time in Seconds
Defragment Tablespace
What Oracle Version do I Have?
INSERT INTO ... SELECT * FROM ...
Oracle Trigger Compilation Warnings/Errors
Get the Oracle Time in Microseconds:
SELECT SYSTIMESTAMP FROM DUAL;
- 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-YYYY HH24: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.
Related Links:
Oracle Date and/or Time in Seconds
Defragment Tablespace
What Oracle Version do I Have?
INSERT INTO ... SELECT * FROM ...
Oracle Trigger Compilation Warnings/Errors
Home > Oracle > Oracle Time in Microseconds
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
Copyright © HelpDoco.com
oracle-microseconds.txt
Oracle/time-in-microseconds.htm
3