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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: interesting ...

RE: interesting ...

From: Diana Duncan <Diana_at_fileFRENZY.com>
Date: Mon, 20 Nov 2000 16:31:00 -0500
Message-Id: <10686.122549@fatcity.com>


Oracle tries very hard to do what you tell it to do. It tries to do automatic conversions where it can. This may be irritating behavior, but there it is. You asked it to translate 11/12/99 into a number, which it happily found that it could do, by treating the '/' characters as division operators.

If you had tried it with '12-NOV-99' you would have received an error message.

Diana

-----Original Message-----
From: bunyamin karadeniz [mailto:bunyamink_at_havelsan.com.tr] Sent: Friday, November 17, 2000 8:10 AM
To: Multiple recipients of list ORACLE-L Subject: interesting ...

 I have a stored procedure

PROCEDURE den1 (a IN number) as
b number;
begin

    b := a;
    dbms_output.put_line(b*5);
end;  

.....  

Result is interesting .  

,0462962962962962962962962962962962962963 which is equal to 11/12/99.  

Why ????
Why did the procedure take the char '11/12/99' as a number 11/12/99 ??  



Bunyamin K. Karadeniz
Enformasyon Teknolojileri Dir.
Veri Tabani Grubu tel : 2873565/1681
HAVELSAN Received on Mon Nov 20 2000 - 15:31:00 CST

Original text of this message

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