0

this problem i don't know step for pass out argument to store procedure

def get_store_procedure(due_id,due_date):
    print("connect to oracle server")
    try:
        conn = jaydebeapi.connect('oracle.jdbc.driver.OracleDriver'
            ,'jdbc:oracle:thin:@127.0.0.1:1523:dws',[ 
            "admin","admin"],'/hdfs/dev/scripts/pyspark/drivers/ojdbc6.jar')

    curs = conn.cursor()
            curs.execute('call  
            orcl.MYFUNC(TO_DATE(?,?),?,?,?)',arg_in1,'yyyy/mm/dd',arg_in2,arg_out1,arg_out2))
bastian
  • 1,122
  • 11
  • 23

1 Answers1

0

You have to specify the parameters as a sequence and not as multiple parameters to the execute() function.

curs.execute('call orcl.MYFUNC(TO_DATE(?,?),?,?,?)',
             (arg_in1, 'yyyy/mm/dd', arg_in2, arg_out1, arg_out2)
            )
bastian
  • 1,122
  • 11
  • 23