As danihp suggests, the difference probably depends on the NLS_LANGUAGE parameter, which is probably derived from the higher NLS parameter. You can override this to get consistent results, although this is not necessarily a good idea - as described in the globalization support guide . Executing these queries should produce consistent results on two servers (assuming one of yours is French from the data you showed):
select to_char(join_date, 'DD-MON-YYYY', 'NLS_DATE_LANGUAGE=FRENCH') from students ...; select to_char(join_date, 'DD-MON-YYYY', 'NLS_DATE_LANGUAGE=ENGLISH') from students ...;
At the heart of the confusion is what you expect from MON . As indicated in the SQL reference , MON is the "month abbreviation"; this means that it is not necessarily an abbreviation of three characters. How the full name of the month is shortened depends on the NLS settings.
In English, all month names can be abbreviated to three characters unambiguously:
select level as l, to_char(to_date(level, 'MM'), 'Month', 'NLS_DATE_LANGUAGE=ENGLISH'), to_char(to_date(level, 'MM'), 'Mon', 'NLS_DATE_LANGUAGE=ENGLISH') from dual connect by level <= 12 order by 1 L TO_CHAR(TO_DATE(LEVEL,'MM'),'MONTH', TO_CHAR(TO_D
In French, this is not so:
select level as l, to_char(to_date(level, 'MM'), 'Month', 'NLS_DATE_LANGUAGE=FRENCH'), to_char(to_date(level, 'MM'), 'Mon', 'NLS_DATE_LANGUAGE=FRENCH') from dual connect by level <= 12 order by 1; L TO_CHAR(TO_DATE(LEVEL,'MM'),'MONTH', TO_CHAR(TO_DATE(LEVE
Clearly, using three-letter abbreviations would create difficulties for Juin and Juillet. Presumably, designating an abbreviation with a period is a cultural thing, and with several months requiring four characters to be distinctive, this reduces the length of the MON format to five characters.
It may seem a little surprising that the format model saves this as a fixed width, so you have space in the middle for shorter abbreviations, as in your original data. I am sure that this could be argued in any case, and it seems that it is being applied consistently. I do not know how to stop this automatically.