-
Ok, Oracle DateTime records time down to the second.
However, in our application we need to query the system time which goes down to millisecond. Then record the date and time down to the millisecond level in some logs.
Any suggestions on how to do that?
-
I think you have to wait till next release. Oracle 8i doesn't support and I heard that 9i supports.
[url]http://www.dbasupport.com/forums/showthread.php?threadid=5538[/url]
-
You can try this approach.
Use the package dbms_utility.get_time
function get_time return number;
-- Find out the current time in 100th's of a second.
-- Output arguments:
-- get_time
-- The time is the number of 100th's of a second from some
-- arbitrary epoch.
Soumya
still learning
-
bkanti,
I am confused, dbms_utility.get_time returns a number, but what does this number signify ? I am sorry, but I couldn't get your explanation exactly, so could you be more specific if you don't mind.
- Mayur.
-
Let me give you an example
DECLARE
start_time NUMBER;
end_time NUMBER;
time_elapsed NUMBER;
...
BEGIN
start_time := dbms_utility.get_time;
......
some transaction ....
.....
end_time := dbms_utility.get_time;
......
--THen time taken for the transaction is
time_elapsed := (end_time - start_time);
/*This time is measured in 1/100ths of a second . You can use it in combination with SYSDATE , which measures upto 1 sec to get time upto 1/100ths of a second and store the result in a VARCHAR2 field */
END;
Soumya
still learning
-
Hi tmnath,
The number is an arbitrary number in time. You can get the number before execution and get the same arbitrary number after the execution. Find the difference between these and divide it by 100. So your execution time is that many seconds.
- ad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|