Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Assign date value to date variable

Re: Assign date value to date variable

From: Frank <news_at_zaphod.demon.nl>
Date: Sat, 11 Nov 2000 19:19:30 GMT
Message-ID: <3a0d98e6.3956097@news.demon.nl>

Try to use single-quotes ...

Frank

On Fri, 10 Nov 2000 14:41:48 GMT, genenatalie_at_my-deja.com wrote:

>Thanks so much.
>In article <8uf7dt$jat$1_at_nnrp1.deja.com>,
> sybrandb_at_my-deja.com wrote:
>> In article <8uf5ut$i3s$1_at_nnrp1.deja.com>,
>> genenatalie_at_my-deja.com wrote:
>> > I'm new Oracle and trying to assign a value to a date variable and
 then
>> > print this value out as follows;
>> >
>> > declare d1 DATE;
>> > d1 := TO_DATE('01062000',"MMDDYYYY");
>> > begin
>> > dbms_output.put_line (to_char(d1, 'mm/dd/yyyy'));
>> > end;
>> >
>> > and get error ORA-06550, how do I do something as seemingly simple
 as
>> > this?
>> >
>> > Sent via Deja.com http://www.deja.com/
>> > Before you buy.
>> >
>>
>> You have an assignment statement within your declaration section. This
>> is incorrect. You are also using " around the format mask instead ' .
>> This is also incorrect.
>> Your code should either read:
>>
>> declare d1 DATE := TO_DATE('01062000','MMDDYYYY');
>> begin
>> dbms_output.put_line (to_char(d1, 'mm/dd/yyyy'));
>> end;
>>
>> or
>>
>> declare d1 DATE ;
>> begin
>> d1 := TO_DATE('01062000','MMDDYYYY');
>> dbms_output.put_line (to_char(d1, 'mm/dd/yyyy'));
>> end;
>>
>> Please read the manuals carefully.
>>
>> Hth,
>>
>> --
>> Sybrand Bakker, Oracle DBA
>>
>> All standard disclaimers apply
>>



>>
>> Sent via Deja.com http://www.deja.com/
>> Before you buy.
>>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Received on Sat Nov 11 2000 - 13:19:30 CST

Original text of this message

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