[英]Oracle Stored Procedure and PyODBC
我在使PyODBC與Oracle中的proc一起工作時遇到麻煩。
下面是代碼和輸出
db = pyodbc.connect('DSN = TEST; UID = cantsay; PWD = cantsay')
print('-' * 20)
try:
c = db.cursor()
rs = c.execute("select * from v$version where banner like 'Oracle%'")
for txt in c.fetchall():
print('%s' % (txt[0]))
test = ""
row = c.execute("call DKB_test.TESTPROC('7894','789465','789465')").fetchall()
finally:
db.close()
輸出值
> C:\Documents and Settings\dex\Desktop>orctest.py
> -------------------- Oracle Database 10g Release 10.2.0.4.0 - 64bit Production Traceback (most recent call last): File "C:\Documents and
> Settings\dex\Desktop\orctest.py", line 31, in <module>
> row = c.execute("{call DKB_test.TESTPROC(12354,78946,123 4)}").fetchall()
> pyodbc.Error: ('HY000', "[HY000] [Oracle][ODBC][Ora]ORA-06550: line 1,
> column 7: \nPLS-00221: 'TESTPROC' is not a procedure
> or is undefined\nORA- 06550: line 1, column 7:\nPL/SQL: Statement
> ignored\n (6550) (SQLExecDirectW)")
但是我可以看到此過程並在c#中將其編碼為有效,但是我正在做的這個項目目前需要python。
我進行了一些Google搜索,但沒有發現任何幫助。
任何事情將不勝感激。
不確定100%,過程名稱是Get_SC_From_Comp_Ven_Job還是GET_SC_FROM_COMP_VEN_JOB?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.