- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- oracle date to millisecond level
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2004 06:47 AM
тАО03-22-2004 06:47 AM
oracle date to millisecond level
Does any body have any utility in java or C which can extract oracle date and display in millisecond level,
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2004 06:52 AM
тАО03-22-2004 06:52 AM
Re: oracle date to millisecond level
http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=148742.1
Problem Description
-------------------
Sometimes it is needed to retrive the system time down to a resolution of milliseconds.
Oracle does not provide this. The highest resolution which can be handled by DATE is 1 second.
The Package DBMS_UTILITY provides a Function GET_TIME which returns the number of 1/100 seconds since an arbitrary point of start. This point of start cannot be changed from outside.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2004 07:06 AM
тАО03-22-2004 07:06 AM
Re: oracle date to millisecond level
HP-UX has the
gettimeofday()
function that gets down to microsecond granularity.
man gettimeofday for details.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2004 04:36 PM
тАО03-22-2004 04:36 PM
Re: oracle date to millisecond level
try:
YD@MYDB.MU> CREATE or replace JAVA SOURCE
2 NAMED "YdTimestamp"
3 AS
4 import java.lang.String;
5 import java.sql.Timestamp;
6
7 public class YdTimestamp
8 {
9 public static String getTimestamp()
10 {
11 return (new
12 Timestamp(System.currentTimeMillis())).toString();
13 }
14* };
YD@MYDB.MU> /
Java created.
YD@MYDB.MU> create or replace function my_timestamp return varchar2
2 AS LANGUAGE JAVA
3 NAME 'YdTimestamp.getTimestamp() return java.lang.String';
4 /
Function created.
YD@MYDB.MU> select my_timestamp, to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
MY_TIMESTAMP
--------------------------------------------------------------------------------
TO_CHAR(SYSDATE,'YY
-------------------
2004-03-23 05:33:41.062
2004-03-23 09:33:32
YD@MYDB.MU>
hope this helps!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2004 04:39 PM
тАО03-22-2004 04:39 PM
Re: oracle date to millisecond level
sorry for the garbled output.
attaching a more readable version.
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2004 04:47 AM
тАО03-23-2004 04:47 AM
Re: oracle date to millisecond level
I need a little modification to this . like if i have a table with a date field . I want to know in millisecond the data was stored.
while retrieving . something like
select my_timstamp(work_dte) from dual;
please advise.
regards
Prasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2004 02:52 PM
тАО03-23-2004 02:52 PM
Re: oracle date to millisecond level
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2004 03:30 PM
тАО03-23-2004 03:30 PM
Re: oracle date to millisecond level
Unfortunately, the SQL92 date/time elements provides this functionality (this feature did not make it into versions lesser than 9i - the granularity of time is down to the second only).
With old versions of Oracle, you can use Java stored procedures or C external procedures to get time at a finer level of detail but you will have to store it in a number field yourself -- it cannot be saved in an Oracle DATE field.
In Oracle 9i, you have the timestamp datatype.
hence there you can do the following:
SQL> create table t ( col1 timestamp);
Table created.
SQL> insert into t select sysdate from dual;
1 row created.
SQL> commit;
Commit complete.
SQL> select col1 from t;
COL1
---------------------------------------------------------------------------
24-MAR-04 08.25.29.000000 AM
SQL>
hope this helps!
regards
Yogeeraj