In a query , I want to change the display format of date to 'mm-dd-yy'. for this I have to use a combination of to_char and to_date. Doesnt oracle provides a function/way to change the display format of date datatype w/o changing the datatype.
Excuse me, but I don't see why you would have to use both to_char and to_date. Wouldn't "TO_CHAR(date_field, 'MM-DD-YY')" be sufficient ? If not, could you post your entire query so that I can see your point and try to help you better ?
Ok, I've read your question again, and I think I see your problem. As I already explained once in this forum (about 3 weeks ago), here is how dates are managed by Oracle :
The date format in Oracle is actually a 7 bytes array, each byte interpreted as an integer between 0 and 255, with :
At index 0 : the century + 100 (120 for 2004)
At index 1 : the year within the century + 100 (104 for 2004)
At index 2 : the month
At index 3 : the day
At index 4 : the hours + 1 (16 for 15:30:00)
At index 5 : the minutes + 1 (31 for 15:30:00)
At index 6 : the seconds + 1 (01 for 15:30:00)
Now, when you make Oracle display a date, it is always as a string, but whatever you want Oracle to display, the date is managed internally as shown above. Consequently, you can't return a date with "MM-DD-YY" as a date format, but you can return a date string representation with "MM-DD-YY", or return a date format, and then convert it to a string representation to display it. Note that in SQLPlus, you will always manage dates through one of their string representations. In JDBC or OCCI programs, however, you can work with the Oracle internal date format.