版权声明:所有文章禁止转载但是均可在生产中使用提高效率 https://blog.csdn.net/viviliving/article/details/83538237
#!/usr/bin/env python
import sys
import csv
import cx_Oracle
import codecs
import os
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.ZHS16GBK'
conn = cx_Oracle.connect("vivigsrp", "vivigsrp", "10.1.1.210/orcl")
curs = conn .cursor()
str1='nice'
str2=' '
#x=curs.callproc('p_demo',[str1,str2]) #x返回的是个array类型的in out组成
lstr1,lstr2=curs.callproc('p_demo',[str1,str2])
print(str2) #这个是取不到返回的out参数的
print(lstr1) #这个是in参数
print(lstr2) #这个是out参数
str2=curs.callfunc('f_demo',cx_Oracle.STRING,[str1])
print(str2)
curs.close()
conn.close()