Opened 13 years ago

Closed 12 years ago

#15994 closed Bug (wontfix)

db VariableWrapper not compatible with cursor.callproc

Reported by: mischko Owned by: nobody
Component: Database layer (models, ORM) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

db/backends/oracle/base.py:class VariableWrapper

  1. from django.db import connection
  2. ora_c = connection.cursor()
  3. bar = 'asdf'
  4. foo = ora_c.var(cx_Oracle.NUMBER)
  5. ora_c.callproc("MY_PKG.MY_SP",[bar, foo])

Gives me an error:

Request Method: POST
Request URL: http://.....
Django Version: 1.3
Exception Type: NotSupportedError
Exception Value: Variable_TypeByValue(): unhandled data type VariableWrapper

So it appears that this is a backward-incompatible change in the upgrade from 1.1 (to 1.2) that is not documented?

The fix for this is to change line 4 to be:
foo = ora_c.var(cx_Oracle.NUMBER).var

Change History (3)

comment:1 by Luke Plant, 13 years ago

Resolution: invalid
Status: newclosed

I'm pretty sure you are using undocumented internals, for which we make no backwards compatibility guarantee. We only say that our connection and cursor objects conform (roughly) to the Python DB-API, which does not include things like var AFAICS.

comment:2 by anonymous, 12 years ago

Resolution: invalid
Status: closedreopened
UI/UX: unset

this is a cx_oracle feature which runs fine without django, AFAIK you should pretty much fix it as the bug reporter is not the only one who suffers with this issue.

comment:3 by Aymeric Augustin, 12 years ago

Resolution: wontfix
Status: reopenedclosed

Per the contribution guidelines, please don't reopen bugs that have been closed by a core developer. You should take the discussion to the django-developers mailing list instead.

I reviewed the original report and I don't see how this is a bug in Django — I can't figure out which parts of the reports come from Django and which parts from the reporter's application.

Note: See TracTickets for help on using tickets.
Back to Top