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: Storing only the time *NOT* the date --- HOW ???

Re: Storing only the time *NOT* the date --- HOW ???

From: Diego Pafumi <dpafumi_at_us.oracle.com>
Date: Tue, 01 Dec 1998 13:15:06 -0800
Message-ID: <36645C59.6C7EA975@us.oracle.com>


Hi jorgen
One thing to do is:

UPDATE my_table SET time_fld = trunc (time-fld);

This (the trunc command) will save your date field without the time

Jørgen Haukland wrote:

> Hello !
>
> I have loaded (with SQL*Loader) data from an ascii-file on the format
> HH24MISS in an DATE column in my table. I can read out the time in SQL with
> SELECT TO_CHAR(time_fld, 'HH24:MI:SS') FROM my_table;
> and that is just fine.
>
> The question is: How do I update my time_fld to store *only* the time (and
> not the date) ??
> When i try (in SQL):
> UPDATE my_table
> SET time_fld =
> (SELECT TO_CHAR(time-fld, 'HH24:MI:SS') FROM my_table);
>
> I get an error (ORA-01843) telling me that I get more than one row in
> return..
>
> Any suggestion on how to update my time_fld ??
>
> Joergen Haukland
> NORWAY
Received on Tue Dec 01 1998 - 15:15:06 CST

Original text of this message

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