Skip to content

Instantly share code, notes, and snippets.

@harleyholt
Created October 11, 2011 01:59
Show Gist options
  • Save harleyholt/1277081 to your computer and use it in GitHub Desktop.
Save harleyholt/1277081 to your computer and use it in GitHub Desktop.
Django Stored Procedure
from django.db import connections
arguments = ('one', 'two', 'three', '...')
cursor = connections['example-db'].cursor()
try:
cursor.callproc('proc_name', arguments)
results = cursor.fetchall()
finally:
cursor.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment