10.4.2013 14:45, Lauri Savolainen kirjoitti:
A little background: my application is used to manage observational data
which is collected from designated routes annually. Each route object
has a set of observation events which in turn have a date field. The
data is managed by using a (terrible) customized Django admin interface.

In the admin interface list view it's possible to search routes using a
custom search box which just injects parameters like ?route_no=1234 and
so forth into the url resulting in a filtered list view. For the most
part this works but when I want to search for routes that, for example,
have observation events past certain date with a query like
?observationevent__observation_date__gte=2010-01-01 (supposed to show
all routes that have been observed this decade) it raises an
DatabaseError: ORA-00932: inconsistent datatypes: expected - got
NCLOB-exception while using an Oracle database in production. The query
seems to work when using a development SQLite database or doing a query
like
Route.objects.filter(observationevent__observation_date__gte='2012-01-01')
directly in the management console even when using the Oracle production
database.

According to the general notes on databases the Oracle backend has
limitations with TextField-related queries
(https://docs.djangoproject.com/en/dev/ref/databases/#textfield-limitations)
and this seems to be causing this as far as I can tell. As the queries
are created by Django admin I have no idea how I should proceed from
here. Is there some kind of easy way to prevent this from happening on
Oracle or should I implement some kind of manual search function?

I am currently using the following versions:
Django==1.4.5
cx-Oracle==5.1.2
gunicorn==0.17.2
virtualenv==1.5.1


Welcome to among us very few and brave to use Oracle... ;)

What comes to your problem few details are missing but:

Length of the field in model definition and what column type is in the database. Also it would be helpful to know are you using legacy database?

Actual error is slightly problematic since it doesn't directly tell what is wrong. It's related types of bind variables and any of them might be incorrect for some reason.

--
Jani Tiainen

- Well planned is half done and a half done has been sufficient before...

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


Reply via email to