Oracle and getting Milliseconds from Sysdate… [Systimestamp]

First, you can’t.

Sysdate doesn’t support going to milliseconds.  However, starting with Oracle 9, you can getting milliseconds from another system source : SYSTIMESTAMP.

SELECT to_char(sysdate, 'HH24:MI:SS'), to_char(systimestamp, 'HH24:MI:SS.FF6') FROM dual;

Powered by Qumana

About these ads
This entry was posted in Oracle. Bookmark the permalink.

3 Responses to Oracle and getting Milliseconds from Sysdate… [Systimestamp]

  1. Phani Kumar says:

    Can u please eloberate as what exactly is FF6 / FF5 will return? And if you substract one systimestamp datatype from other, what it will return and what will be the output datatype?

  2. piyush says:

    select to_timestamp(to_char(systimestamp(3),’YYYY-MM-DD HH24:MI:SS:FF3′),”) from dual

    can this display result in format ‘YYYY-MM-DD HH24:MI:SS:FF3′ anyway i want result in time stamp data type only and in this format for inserting it into tables

  3. jasonvogel says:

    I actually moved my Blog to http://jasonvogel.blogspot.com/2006/11/example-using-systimestamp-milliseconds.html. The version at this URL is up to date, and includes at least some of what you’re looking for.

    Jason

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s