您的位置:首页 > 数据库 > Oracle

python调用oracle存储过程(packeage)

2015-07-14 13:38 555 查看
http://markmail.org/message/y64t5mqlgy4rogte

http://www.oracle.com/technetwork/cn/articles/prez-stored-proc-096180-zhs.html

import cx_Oracle
dsn = cx_Oracle.makedsn('10.10.196.218','1521','ORACLE2')
conn = cx_Oracle.connect('x5user','x5user',dsn)
c = conn.cursor()
str = c.var(cx_Oracle.CURSOR)
str2 = c.callproc('pack_pollutant.proc_pollutantdata',[str])
rs = str2[-1].fetchall()
print(rs)
c.close
conn.close

str = c.var(cx_Oracle.NUMBER)
str2=c.callproc('proc_s2_back',[str])
print(str2)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: