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!

to_char(date) gives the result 00-000-00 More options

user566020Mar 26 2007 — edited Mar 26 2007
first row was inserted using the sql insert.
remaining rows are inserted from the c++ engine

When i do to_char of the date y it give me 00-000-00


SQL> select to_char(y),y from x;


TO_CHAR(Y) Y
--------------- ---------
23-MAR-07 23-MAR-07
00-000-00 01-JUN-01
00-000-00 01-JUL-01
00-000-00 01-OCT-01


But when i do to_char(to_date(y)) it give the correct dates


SQL> select to_char(to_date(y)),y from x;


TO_CHAR(TO_DATE Y
--------------- ---------
23-MAR-07 23-MAR-07
01-JUN-01 01-JUN-01
01-JUL-01 01-JUL-01
01-OCT-01 01-OCT-01


SQL> select dump(y) from x;


DUMP(Y)
---------------------------------------------------------------------------­-----
Typ=12 Len=7: 120,107,3,23,16,52,56
Typ=12 Len=7: 120,101,6,1,0,0,0
Typ=12 Len=7: 120,101,7,1,0,0,0
Typ=12 Len=7: 120,101,10,1,0,0,0


Can anyone tell me what the problem is and how can it be resolved?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2007
Added on Mar 26 2007
5 comments
1,516 views