On Jan 20, 3:05 pm, citos88 <cito...@gmail.com> wrote:
> I use Django and Oracle, and I want call oracle's function and catch
> and save to django's variable this what return that function. How can
> I do this?

You'll need to get a database cursor and use its callfunc method,
something like this:

from django.db import connection
import cx_Oracle

cursor = connection.cursor()
result = cursor.callfunc('degrees_to_celsius', cx_Oracle.NUMBER,
[212])
print(result)

For more information, see:

https://docs.djangoproject.com/en/1.3/topics/db/sql/#executing-custom-sql-directly
http://cx-oracle.sourceforge.net/html/cursor.html#Cursor.callfunc

Cheers,
Ian

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