Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Storing only the time *NOT* the date --- HOW ???
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
![]() |
![]() |