我在让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搜索,但没有任何内容可以帮助我。
任何事情都将不胜感激。
答案 0 :(得分:0)
不是100%肯定,程序名称是Get_SC_From_Comp_Ven_Job还是GET_SC_FROM_COMP_VEN_JOB?