On Apr 21, 11:03 am, kamal sharma <kamalp.sha...@gmail.com> wrote:
> Error while trying to retrieve text for error ORA-01804
>
> Here is my code to fetch the data from database.
>
> def cases(request, dbname, prnum=None, message=''):
>
>     connection = cx_Oracle.Connection("%s/%s@%s" % ('foo', 'bar', 'xyz'))
>     cursor = cx_Oracle.Cursor(connection)
>     sql = "SELECT fielname FROM tablename where rownum < 10"
>     cursor.execute(sql)
>     names = [row[0] for row in cursor.fetchall()]
>     cursor.close()
>     connection.close()

First of all, why are you creating your own connection instead of
using the Django ORM?

Anyway, the proper way to create a cx_Oracle connection is with the
cx_Oracle.connect factory function, and the proper way to create a
cursor is with the connection.cursor() method.  See the cx_Oracle docs
and the DB-API docs for details.  However, I think there is something
more going on here.

ORA-01804:      failure to initialize timezone information
Cause:  The timezone information file was not properly read.
Action:         Please contact Oracle Customer Support.

This and the fact that cx_Oracle wasn't able to look up the error code
itself suggest that there may be something wrong with your Oracle
client installation.  Or it may be that your webserver is also
blocking access to the files in the client directory.  What happens if
you try the same code from a Python shell?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to