python调用oracle存储过程(packeage)

http://markmail.org/message/y64t5mqlgy4rogte

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

 

 1 import cx_Oracle
 2 dsn = cx_Oracle.makedsn('10.10.196.218','1521','ORACLE2')
 3 conn = cx_Oracle.connect('x5user','x5user',dsn)
 4 c = conn.cursor()
 5 str = c.var(cx_Oracle.CURSOR)
 6 str2 = c.callproc('pack_pollutant.proc_pollutantdata',[str])
 7 rs = str2[-1].fetchall()
 8 print(rs)
 9 c.close
10 conn.close
11 
12 
13 
14 str = c.var(cx_Oracle.NUMBER)
15 str2=c.callproc('proc_s2_back',[str])
16 print(str2)

 

posted @ 2015-07-14 13:38  海天依色  阅读(918)  评论(0编辑  收藏  举报