NLS_DATE_FORMAT issues when using OLE DB
645847Jun 18 2008 — edited Jul 1 2008We have noticed some inconsistencies when using the DATE datatype with OLE DB.
The Oracle 8i documentation indicated "NLS_DATE_FORMAT is fixed for the session to 'YYYY-MM-DD HH24:MI:SS' by the provider and it cannot be changed."
The Oracle 11g documentation indicates that the date format can be controlled with a registry setting (UseSessionFormat). If set to TRUE (or 1) then the default NLS_DATE_FORMAT for the instance is used. In our testing so far only Oracle 11g seems to use this registry setting. Is this functionality new for Oracle 11g, or was it added in a previous version?
Also we noticed that it doesn't really follow the NLS_DATE_FORMAT. We use the default of: DD-MON-RR
Thus I would expect that 11 June 2008 would be entered as: 11-JUN-08
and I would expect a query to return identically the same value. However it comes back as: 2008-06-11 00:00:00
This is certainly not the NLS_DATE_FORMAT specified. It is better than we see in 10g where for the same registry settings and INSERT statement the return value would be: 0011-06-08 00:00:00
Any hints on how to get INSERTs and QUERYs to use the same format are appreciated. Also I would like to know if this is possible before 11g?
The 10.0.2 documentation indicates that the UseSessionFormat functionality was available with 9.2.0.4. The documentation states that "this attribute does not appear under the key" but later states "if the attributes are provided, then these new values override the default registry values". This is a solid statement that if I add these registry values, they will be used.
Message was edited by:
user642844