Hello.
This code works fine:
>>> import cx_Oracle
>>> lDsn = cx_Oracle.makedsn(lDatabaseHost, int(lDatabasePort),
lDatabaseName)
>>> lConnectString = "%s/%...@%s" % (lDatabaseUsername,
lDatabasePassword, lDsn)
>>> lConnection = cx_Oracle.connect(lConnectString)
>>> cursor = lConnection.cursor()
>>> lOutput = cursor.var(cx_Oracle.STRING)
>>> cursor.execute("BEGIN :out := 'N'; END;", {'out' : lOutput})
>>> print lOutput
<cx_Oracle.STRING with value 'N'>
>>> print lOutput.getvalue()
N
However, if I change this to get the connection from Django, it all
falls in a big heap:
>>> from django.db import connection
>>> cursor = connection.cursor()
>>> import cx_Oracle
>>> lOutput = cursor.var(cx_Oracle.STRING)
>>> cursor.execute("BEGIN :out := 'N'; END;", {'out' : lOutput})
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/dev/HEAD/INTERNAL/websites/Wam3\django\db\backends\util.py",
line 19, in execute
return self.cursor.execute(sql, params)
File "/web/djangocourse\django\db\backends\oracle\base.py", line 435,
in execute
query = convert_unicode(query % tuple(args), self.charset)
TypeError: not all arguments converted during string formatting
Can anyone point me in the direction of how I can fix this?
Cheers,
Tim.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@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.