Skip to Main Content

DevOps, CI/CD and Automation

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!

NLS_DATE_FORMAT issues when using OLE DB

645847Jun 18 2008 — edited Jul 1 2008
We 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 16 2008
Added on Jun 18 2008
0 comments
3,062 views