Django stored procedure with sys_refcursor output
hariselva | March 4, 2020, 1:01 a.m.

This post explains the execution of stored procedure from Django project

with connection.cursor() as cursor:
	defect_row = []
	dcursor = ncursor.connection.cursor()
	out_arg = dcursor.var(cx_Oracle.CURSOR)
	ncursor.callproc(<stored procedure>, [args])
	for row in out_arg.getvalue():
		print(row)
	dcursor.close()
ncursor.close()

row variable contains the results of out cursor

out_arg.description provides the column description