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

Home -> Community -> Usenet -> c.d.o.server -> Re: sysdate problem from a newbie

Re: sysdate problem from a newbie

From: Kenneth Koenraadt <plovmand_at_hotmail.com>
Date: Fri, 17 Aug 2001 17:11:03 GMT
Message-ID: <3b7d4f89.1939875@news.mobilixnet.dk>


On Fri, 17 Aug 2001 15:45:18 GMT, "grAbbY0" <grAbbY0_at_hotmail.com> wrote:

>Hi there,
>
>I would appreciate some help here,
>
>We have a table called Alarms, every day I have to delete all the alarms in
>this table that were created two days before the current date. (To prevent
>the table from being filled up). These Alarms are generated in a SCADA
>application which generates the time of the Alarms in a column called ITIME.
>The datatype is char and the value is like: 20010817164555.000
>(YYYYMMDDHHMISS). I cant remove the '.000' because this has to be a standard
>value.
>I am trying this with SYSDATE but then I get the error 'date format picture
>ends before converting entire input string'
>
>Anybody got an idea??
>
>Thanx in advance

Sure,

delete from Alarms where
to_date(substr(Itime,1,length(itime)-4),'YYYYMMDDHHMISS') < sysdate-2;

Regards,
Kenneth Koenraadt
Systems Consultant
Oracle DBA
plovmand@<no-spam>hotmail.com Received on Fri Aug 17 2001 - 12:11:03 CDT

Original text of this message

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