#------------------------------------------------------------------------------ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # PLSQLProcedure.py # # Demonstrate how to call a PL/SQL stored procedure and get the results of an # OUT variable. #------------------------------------------------------------------------------ import cx_Oracle import SampleEnv connection = cx_Oracle.connect(SampleEnv.GetMainConnectString()) cursor = connection.cursor() myvar = cursor.var(int) cursor.callproc('myproc', (123, myvar)) print(myvar.getvalue())