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: Mark Rosenbaum <mjr_at_netcom.com>
Date: Sun, 31 May 1998 14:14:21 GMT
Message-ID: <mjrEttrJx.27H@netcom.com>


In article <_R4c1.3375$AN2.3763270_at_news3.atl.bellsouth.net>, DerWoud <derwoud_at_bellsouth.net> wrote:
>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
>
>

Scott,

If you are trying to insert the current date (as your column name would indicate) try sysdate.

mjr Received on Sun May 31 1998 - 09:14:21 CDT

Original text of this message

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