From: news@zaphod.demon.nl (Frank)
Newsgroups: comp.databases.oracle.misc
Subject: Re: Assign date value to date variable
Date: Sat, 11 Nov 2000 19:19:30 GMT
Message-ID: <3a0d98e6.3956097@news.demon.nl>
References: <8uf5ut$i3s$1@nnrp1.deja.com> <8uf7dt$jat$1@nnrp1.deja.com> <8uh1fa$ea$1@nnrp1.deja.com>
NNTP-Posting-Host: zaphod.demon.nl
X-NNTP-Posting-Host: zaphod.demon.nl:212.238.65.251
X-Trace: news.demon.nl 973970306 pluto:29983 NO-IDENT zaphod.demon.nl:212.238.65.251
X-Complaints-To: abuse@nl.demon.net
X-Newsreader: Forte Free Agent 1.21/32.243
Lines: 66


Try to use single-quotes ...

Frank

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

>Thanks so much.
>In article <8uf7dt$jat$1@nnrp1.deja.com>,
>  sybrandb@my-deja.com wrote:
>> In article <8uf5ut$i3s$1@nnrp1.deja.com>,
>>   genenatalie@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.


