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!

Play around with TO_CHAR date format

715920Dec 20 2010 — edited Dec 21 2010
Dear all,
I'm learning how TO_CHAR function and date format code work by using dual table, but I got some difficulties:
SQL> select to_char(sysdate,'dl') test from dual;

TEST
-----------------------------
Monday, December 20, 2010

SQL> select to_char(sysdate) test from dual;

TEST
---------
20-DEC-10

SQL> select sysdate test from dual;

TEST
---------
20-DEC-10

SQL> select to_char('20-DEC-10','dl') test from dual;
select to_char('20-DEC-10','dl') test from dual
               *
ERROR at line 1:
ORA-01722: invalid number
How can I pass an explicit date to TO_CHAR function?

Best regards,
Valerie
This post has been answered by BluShadow on Dec 20 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2011
Added on Dec 20 2010
7 comments
2,462 views