Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

why oracle "to_date" accepts Date-parameters

WestDraytonOct 21 2010 — edited Oct 21 2010
I tested out function "to_date" as you see below and I see that Oracle allows me to give to that function parameter with textual data type and also allows to parameter's datatype to be Date.
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 
 
SQL> 
SQL> select to_date(sysdate) as s from dual;--21.10.2010
 
S
-----------
21.10.2010
SQL> select to_date(sysdate, 'DD.MM.YYYY') as s from dual;--21.10.2010
 
S
-----------
21.10.2010
SQL> select to_date('21.10.2010', 'DD.MM.YYYY') as s from dual;--21.10.2010
 
S
-----------
21.10.2010
SQL> select to_date(to_date('21.10.2010', 'DD.MM.YYYY')) as s from dual;--21.10.2010
 
S
-----------
21.10.2010
SQL> 
I entered into Search engine "http://www.lycos.com/" phrase "oracle to_date function" and it gave me link to documentation of that function:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions183.htm
and the documentation says:
>
Purpose

TO_DATE converts char of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 datatype to a value of DATE datatype.
>

My question is: why the function accepts Date data types? what occures behind curtains when Date is passed in? Or what explanation there is, that documentation seems to lie?

Also, have you too noticed that the forum has been oftenly down near past days?
This post has been answered by SomeoneElse on Oct 21 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 18 2010
Added on Oct 21 2010
6 comments
743 views