Thread: Seconds
View Single Post

   
  #4 (permalink)  
Old 04-08-2008, 10:04 AM
Anurag Varma
 
Posts: n/a
Default Re: Seconds


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

Reply With Quote