Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> interesting ...
This is a multi-part message in MIME format.
------=_NextPart_000_00EC_01C0217B.F8DA6450 Content-Type: text/plain;
charset="iso-8859-9"
Content-Transfer-Encoding: quoted-printable
I have a stored procedure =20
PROCEDURE den1 (a IN number) as
b number;=20
begin=20
b :=3D a;=20
dbms_output.put_line(b*5);
end;
And I use accept command of sql plus.=20
ACCEPT datehired DATE FORMAT 'dd/mm/yy' DEFAULT '11/11/1111' PROMPT =
'enter the date:' ;
I enter 11/12/99 when asks me to enter the date .
Wrote define and seen that datehired parameter is char.
And then I executed the den1 procedure by passing the datehired =
parameter (which is date ) by=20
EXEC den1(&datehired);=20
And did not give an error although it had shown that ( when =FD wrote = define) it is a char parameter and I wanted to pass a char to a number = ..
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 ??
=20
------=_NextPart_000_00EC_01C0217B.F8DA6450 Content-Type: text/html;
charset="iso-8859-9"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-9" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2014.210" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#a6caf0>
<DIV><FONT face=3DArial size=3D2> I have a stored procedure =
</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>PROCEDURE den1 (a IN number) as<BR>b =
number;=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>begin </FONT></DIV>
<DIV><FONT face=3DArial size=3D2> b :=3D a; </FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
dbms_output.put_line(b*5);</FONT></DIV><DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>end;</FONT></DIV>
char.</FONT></DIV>
size=3D2>**********************************************<BR>Bunyamin K.=20Karadeniz<BR>Enformasyon Teknolojileri Dir.<BR>Veri Taban=FD Grubu tel : =
2873565/1681<BR>HAVELSAN=20 Received on Mon Sep 18 2000 - 06:23:10 CDT
![]() |
![]() |