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: SQL insert date ?

Re: SQL insert date ?

From: DerWoud <derwoud_at_bellsouth.net>
Date: Sun, 31 May 1998 04:18:02 GMT
Message-ID: <_R4c1.3375$AN2.3763270@news3.atl.bellsouth.net>


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

Original text of this message

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