Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL insert date ?
insert into info (currentdate)
values (to_date('1998-01-01 12:00:00','YYYY-MM-DD HH:MI:SS');
You insert the text wrapped in a TO_DATE function. Feed TO_DATE the data and
format of the data you want to convert to a date. For things that must use
2 digit years 'RR' should be substituted in place of 'YY' for Y2K
compliance, if the date is past 1949.
DerWoud
Scott Andrew Wehrmann wrote in message
<6komcv$718_at_phoenix.csc.calpoly.edu>...
>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 Sat May 30 1998 - 23:18:02 CDT