• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql
You are here: Home / Oracle / function / NUMTODSINTERVAL Function in Oracle SQL – PLSQL

NUMTODSINTERVAL Function in Oracle SQL – PLSQL

November 5, 2012 by techhoneyadmin

The NUMTODSINTERVAL function in Oracle SQL / PLSQL is used to convert any number to an Interval Day to Second Literal.

Syntax for the NUMTODSINTERVAL function in Oracle SQL / PLSQL is:

SELECT NUMTODSINTERVAL(number,expression)
FROM table_name;

  • ‘number’ is the number to be converted to interval
  • ‘expression’ is the unit and can have the following values: ‘DAY’, ‘HOUR’, ‘MINUTE’ OR ‘SECOND’

Example 1:

SELECT NUMTODSINTERVAL(250, 'DAY')
FROM DUAL; 

May return “+250 00:00:00.000000”


Example 2:

SELECT NUMTODSINTERVAL(2500, 'HOUR')
FROM DUAL; 

May return “+104 04:00:00.000000”


Example 3:

SELECT NUMTODSINTERVAL(25000, 'MINUTE')
FROM DUAL; 

May return “+17 08:40:00.000000”


Example 4:

SELECT NUMTODSINTERVAL(250000, 'SECOND')
FROM DUAL; 

May return “+02 21:26:40.000000”


Filed Under: function Tagged With: how to use numtodsinterval function in oracle database query, how to use numtodsinterval function in oracle plsql, how to use numtodsinterval function in oracle sql, numtodsinterval function in oracle plsql, numtodsinterval function in oracle sql, NUMTODSINTERVALPLSQL, syntax and example of numtodsinterval function in oracle database query, syntax and example of numtodsinterval function in oracle plsql, syntax and example of numtodsinterval function in oracle sql, using numtodsinterval function in oracle database query, using numtodsinterval function in oracle plsql, using numtodsinterval function in oracle sql

Copyright © 2023 · Parallax Pro on Genesis Framework · WordPress · Log in