Thanks, I'll look into that. In the meantime, I managed to just use the
cursor from cx_Oracle (as in the example on Oracle site) and the code looks
slightly more elegant.

However, both "my" and yours solution suffer from the same defect imho --
that the ORM machinery of Django is unusable. We are back to manual mapping
of rows onto objects... Or -- am I mistaken?



Tim Sawyer-6 wrote:
> 
>> Friends,
>>
>> I'm in need of an implementation which calls for using bind variables (in
>> Oracle sense, not generic) in my SQL in a Django application.
>>
>> Any experience with that, anyone?
> 
> Here's an example using bind variables to return output values from a 
> PL/SQL block.
> 
>   >>> import cx_Oracle
>   >>> from django.db import connection
>   >>> cursor = connection.cursor()
>   >>> lOutput = cursor.var(cx_Oracle.STRING)
>   >>> cursor.execute("BEGIN %s := 'N'; END; ", [lOutput])
>   >>> print lOutput
>   <cx_Oracle.STRING with value None>
>   >>> print lOutput.getvalue()
>   None
>   >>>
> 
> There was a bug in Django that prevented this working (hence the None in 
> the code above) - it's fixed in Django 1.2. The full thread for this is 
> at
> http://www.mail-archive.com/django-users@googlegroups.com/msg100490.html
> 
> Hope that will help send you in the right direction.
> 
> 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.
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Bind-variables-in-Oracle-backend---how-to-use-them--tp29431038p29475966.html
Sent from the django-users mailing list archive at Nabble.com.

-- 
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.

Reply via email to