I am trying to call a oracle stored procedure with 2 in and 1 out parameter from python script. The problem I am having is passing a cursor out-parameter.
The Oracle stored procedure is essentially:
PROCEDURE ci_lac_state
(LAC_ID_IN IN VARCHAR2,
CI_ID_IN IN VARCHAR2 DEFAULT NULL,
CGI_ID OUT SYS_REFCURSOR)
AS
BEGIN
OPEN cgi_id FOR
...
END;
The python code calling to the database is:
#! /usr/bin/python
import cx_Oracle
lac='11508'
ci='9312'
try:
my_connection=cx_Oracle.Connection('login/passwd@db_name')
except cx_Oracle.DatabaseError,info:
print "Logon Error:",info
sys.exit()
my_cursor=my_connection.cursor()
cur_var=my_cursor.var(cx_Oracle.CURSOR)
my_cursor.callproc("cgi_info.ci_lac_state", [lac, ci, cur_var])
print cur_var.getvalue()
And I get such cursor value as the result:
<__builtin__.OracleCursor on <cx_Oracle.Connection to login@db_name>>
What am I doing wrong?
Thanks.