Re: Why Oracle is not adding a second to date/time:

From: Charles Hooper <hooperc2000_at_yahoo.com>
Date: Thu, 5 Feb 2009 16:33:26 -0800 (PST)
Message-ID: <7e28d77e-11de-47bc-9ad7-d2e0bfb792f4_at_k36g2000pri.googlegroups.com>



On Feb 5, 5:49 pm, zigzag..._at_yahoo.com wrote:
> I am using Oracle 10.2 on HP UNIX 11i
>
> I have table lasttime with a column runtime (of type date)./
> select * from lasttime;
>    02/04/2009 22:35:38
> I want to add one second
> to runtime.  I am unable to do it using following statement:
>
> Update lasttime set runtime = to_date('20090204223538',
> 'YYYYMMDDHH24MISS') + 1/(24 * 60 *60);
>
> It still shows me:
> select * from lasttime;
>    02/04/2009 22:35:38
>
> I can always add a minute or hour but second does not work. I do not
> know what I
> Am doing wrong?

Try the following test:
SQL> CREATE TABLE T5(C1 DATE); Table created.

SQL> INSERT INTO T5 VALUES (NULL); 1 row created.

SQL> UPDATE T5 SET C1=TO_DATE('20090204223538','YYYYMMDDHH24MISS') +(1/24/60/60);

1 row updated.

SQL> SELECT TO_CHAR(C1,'YYYYMMDDHH24MISS') FROM T5; TO_CHAR(C1,'YY



20090204223539

SQL> SELECT VERSION FROM V$INSTANCE; VERSION



10.2.0.4.0

Finally, try:
SQL> DESC LASTTIME Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. Received on Thu Feb 05 2009 - 18:33:26 CST

Original text of this message