Re: DatabaseError: ORA-01843: not a valid month

Andrey Nikolaev <[email protected]>
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAGxQLzd4ZPvQOBALg-Ab1oO8Lq59UrcmvdUWzUtJESyeKUGUAg@mail.gmail.com>
My environment : cx_Oracle 5.1.2, Oracle 11.2.0.1.0, Python 2.6.6

I use the following code:


>>>
>>> curr.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD
HH24:MI:SS' NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF'")
>>> curr.execute("select * from NLS_SESSION_PARAMETERS")
<__builtin__.OracleCursor on <cx_Oracle.Connection to wtrackeru@orcl>>
>>> curr.fetchall()
[('NLS_LANGUAGE', 'AMERICAN'), ('NLS_TERRITORY', 'AMERICA'),
('NLS_CURRENCY', '$'), ('NLS_ISO_CURRENCY', 'AMERICA'),
('NLS_NUMERIC_CHARACTERS', '.,'), ('NLS_CALENDAR', 'GREGORIAN'),
('NLS_DATE_FORMAT', 'YYYY-MM-DD HH24:MI:SS'), ('NLS_DATE_LANGUAGE',
'AMERICAN'), ('NLS_SORT', 'BINARY'), ('NLS_TIME_FORMAT', 'HH.MI.SSXFF AM'),
('NLS_TIMESTAMP_FORMAT', 'YYYY-MM-DD HH24:MI:SS.FF'),
('NLS_TIME_TZ_FORMAT', 'HH.MI.SSXFF AM TZR'), ('NLS_TIMESTAMP_TZ_FORMAT',
'DD-MON-RR HH.MI.SSXFF AM TZR'), ('NLS_DUAL_CURRENCY', '$'), ('NLS_COMP',
'BINARY'), ('NLS_LENGTH_SEMANTICS', 'BYTE'), ('NLS_NCHAR_CONV_EXCP',
'FALSE')]
>>> curr.execute("select to_date(:0), to_timestamp(:1) from dual",
[u'2013-03-12', u'2013-03-12 08:22:31.332144'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cx_Oracle.DatabaseError: ORA-01843: not a valid month

>>>

--
Best regards,
Andrey Nikolaev                            mailto:[email protected]

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.