Home » SQL & PL/SQL » SQL & PL/SQL » time in microseconds
time in microseconds [message #222542] Mon, 05 March 2007 06:34 Go to next message
meeta
Messages: 28
Registered: January 2000
Junior Member
Can anyone tell me how to get time in microseconds using to_char function?????
Re: time in microseconds [message #222546 is a reply to message #222542] Mon, 05 March 2007 06:48 Go to previous messageGo to next message
rigatonip
Messages: 50
Registered: December 2005
Member
You can get to microseconds like this with a timestamp. But it won't work with the regular date format. You can conver the date format to a timestamp but you wouldn't have the data fidelity you need.

SQL>  SELECT to_char(systimestamp, 'hh24:mi:ss.ff6') from dual;

TO_CHAR(SYSTIMESTA
------------------
07:41:06.313000

SQL> SELECT to_char(systimestamp, 'hh24:mi:ss.ff6') as timestamp from dual;

TIMESTAMP
------------------
07:41:25.120000

SQL> select to_char(sysdate, 'hh24:mi:ss.ff6') as timestamp from dual;
select to_char(sysdate, 'hh24:mi:ss.ff6') as timestamp from dual
                        *
ERROR at line 1:
ORA-01821: date format not recognized


SQL> select to_char( cast(sysdate as timestamp), 'hh24:mi:ss.ff6') as timestamp from dual;

TIMESTAMP
------------------
07:46:16.000000

Re: time in microseconds [message #222557 is a reply to message #222546] Mon, 05 March 2007 07:10 Go to previous message
meeta
Messages: 28
Registered: January 2000
Junior Member
Thanks a lot
Previous Topic: Sub Query with IN
Next Topic: If clause in cursors
Goto Forum:
  


Current Time: Fri Dec 09 09:45:31 CST 2016

Total time taken to generate the page: 0.05901 seconds