Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL insert date ?
You should try reading the manual.
Oracle has a default date format generally DD-MON-YY eg 1-JAN-98. Any
date stored with
any time component is automatically displayed in the default format. The
other parts are not gone,
just not displayed.
To insert a specific date and time
insert into info (currentdate) values to_date('1998-06-19 17:00:00', 'YYYY-MM-DD 24HR:MI:SS') Note Oracle does not track time below a second.
Mike Krolewski
Scott Andrew Wehrmann wrote:
> If I have a table that is declared as,
>
> create table info (
> currentdate date
> )
>
> How do I insert a date that looks like '1998-06-19 17:00:00.0'? Do I
> have to use the to_date function, or is there a way I can just insert
> the date?
> I've tried insert into info values ('1998-06-19 17:00:00.0'), but it
> gives me an error. Thanks for any suggestions.
>
> -- Scott Wehrmann
Received on Thu Jun 04 1998 - 02:43:16 CDT