python-cx_Oracle/samples/PLSQLFunction.py
Anthony Tuininga 81583c224d Reworked samples so that no default passwords are defined anywhere; added
Python script to create sample schemas and drop them in addition to having a
SQL*Plus script.
2019-01-31 10:15:40 -07:00

22 lines
722 B
Python

#------------------------------------------------------------------------------
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# PLSQLFunction.py
#
# Demonstrate how to call a PL/SQL function and get its return value.
#------------------------------------------------------------------------------
from __future__ import print_function
import cx_Oracle
import SampleEnv
connection = cx_Oracle.connect(SampleEnv.GetMainConnectString())
cursor = connection.cursor()
res = cursor.callfunc('myfunc', int, ('abc', 2))
print(res)