Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

to_char on an interval

John_KSep 5 2019 — edited Sep 5 2019

I'm sure this must have already been raised as an idea, but having searched I couldn't see it. This would be very useful:

select to_char(numtodsinterval(20,'second'),'HH:MI:SS') from dual

(obviously only allow a format mask which make sense for an interval).

currently to achieve such a result it's long-winded.

select to_char(extract(hour from i), 'fm00')||

       ':' ||

       to_char(extract(minute from i), 'fm00')||

       ':' ||

       to_char(extract(second from i), 'fm00')

         fmt

  from (select numtodsinterval(20, 'second') i from dual)

Comments
Post Details
Added on Sep 5 2019
5 comments
2,598 views