Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Seconds

Re: Seconds

From: Anurag Varma <avoracle_at_gmail.com>
Date: 24 Mar 2006 07:47:01 -0800
Message-ID: <1143215221.668614.247040@u72g2000cwu.googlegroups.com>

You fail to state the version of Oracle. At least in 9i and above, there is a "interval day to seconds" datatype.
Which might be closer to what you want.
Unless you want to write a routine yourself to do this conversion.

ORA92> create table dhms (a number, b interval day(0) to second(0));

Table created.

ORA92> insert into dhms (a) values (10720);

1 row created.

ORA92> insert into dhms (a) values (31);

1 row created.

ORA92> update dhms set b = numtodsinterval(a, 'second');

2 rows updated.

ORA92> commit;

Commit complete.

ORA92> select * from dhms;

         A B



     10720 +0 02:58:40
        31 +0 00:00:31


Anurag Received on Fri Mar 24 2006 - 09:47:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US