[RADIATOR] SQL query on timestamp (integer)

rohan.henry cwjamaica.com rohan.henry at cwjamaica.com
Fri Dec 23 22:49:48 UTC 2016


All, 

How can I convert to date when querying the radusage table with timestamp stored as integer? 

TIME_STAMP NUMBER(38) 



SQL> select time_stamp from radusage where rownum<3; 




TIME_STAMP 
---------- 
1143874140 
1143874141 

Neither of the SQL queries below works. 

SQL> select to_char(to_date(TIME_STAMP,'YYYYMMDDHH24MISS'), 'YYYY-MON-DD HH24:MI:SS') from radusage; 
select to_char(to_date(TIME_STAMP,'YYYYMMDDHH24MISS'), 'YYYY-MON-DD HH24:MI:SS') from radusage 
* 
ERROR at line 1: 
ORA-01843: not a valid month 


SQL> select to_char(to_date(TIME_STAMP,'YYYY-MM-DD HH24MISS'), 'YYYY-MON-DD HH24:MI:SS') from radusage; 
select to_char(to_date(TIME_STAMP,'YYYY-MM-DD HH24MISS'), 'YYYY-MON-DD HH24:MI:SS') from radusage 
* 
ERROR at line 1: 
ORA-01861: literal does not match format string 

Thanks, 
Rohan 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.open.com.au/pipermail/radiator/attachments/20161223/d2798708/attachment.html>


More information about the radiator mailing list