#20292: Django 1.5.1: ORA-01843: not a valid month -------------------------------------+------------------------------------- Reporter: CarstenF | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: 1.5 (models, ORM) | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: Oracle, cx_oracle, | Needs documentation: 0 unicode | Patch needs improvement: 0 Has patch: 0 | UI/UX: 0 Needs tests: 0 | Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by jtiai): This seems to be bug in Oracle 10g. Explanation: Any unicode (NVARCHAR2) to DATE datatype conversion seems to trigger something inside Oracle that causes session nls parameters to break. Following unicode (NVARCHAR2) to TIMESTAMP datatype conversion fails which in turn causes all non-unicode to TIMESTAMP datatype conversions fail as well. Here folloows solid test case that fill work exactly as comments do state: {{{#!sql ALTER SESSION SET NLS_TERRITORY = 'AMERICA'; ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS' NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF'; REM --- WORKS: SELECT TO_TIMESTAMP('2013-06-24 18:15:10.312') FROM DUAL; REM --- WORKS: SELECT TO_DATE('2013-06-24 18:15:10') FROM DUAL; REM --- WORKS: SELECT TO_TIMESTAMP('2013-06-24 18:15:10.312') FROM DUAL; REM --- WORKS: SELECT TO_TIMESTAMP(x) FROM (SELECT CAST('2013-06-24 18:15:10.312' AS NVARCHAR2(30)) AS X FROM DUAL); REM --- WORKS: SELECT TO_DATE(x) FROM (SELECT CAST('2013-06-24 18:15:10' AS NVARCHAR2(30)) AS X FROM DUAL); REM --- WORKS: SELECT TO_TIMESTAMP('2013-06-24 18:15:10.312') FROM DUAL; REM !!! FAILS! SELECT TO_TIMESTAMP(x) FROM (SELECT CAST('2013-06-24 18:15:10.312' AS NVARCHAR2(30)) AS X FROM DUAL); REM !!! FAILS! SELECT TO_TIMESTAMP('2013-06-24 18:15:10.312') FROM DUAL; REM --- WORKS: SELECT TO_DATE('2013-06-24 18:15:10') FROM DUAL; }}} -- Ticket URL: <https://code.djangoproject.com/ticket/20292#comment:10> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.057b7d833dd57fe902fccc304b9bd738%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.