Send a multidimensional array to stored procedure cx_Oracle

433 views Asked by At
Code Oracle:

 Procedure example
    (
    p_Cod_Rspta             out varchar2             ,
    p_error_Rspta           out varchar2             ,
    p_ID_USUAR              in   Number              ,
    p_reg_Aplic             in   SYS_REFCURSOR       ,
    p_reg_Rta_Excel         out  SYS_REFCURSOR        
    )

Here is where I want to send the ref cursor calling the procedure example

Code Python:
    cur = con.cursor()
    cursor= cur.var(cx_Oracle.CURSOR)
    cur.callproc("package.example",[cur.var(cx_Oracle.STRING),cur.var(cx_Oracle.STRING),ID_U,cursor,cur.var(cx_Oracle.CURSOR)]
1

There are 1 answers

2
Anthony Tuininga On

You cannot pass a set of data in as a cursor. The data in a cursor must be populated from a query that is executed in the database. You can, however, pass in an array of records into PL/SQL. Note that this is only possible in Oracle 12c with cx_Oracle 5.3.