2

与 Oracle 有联系(效果很好):

import pypyodbc as pyodbc
cnxn=pyodbc.connect("DSN=ORCL;PWD=user1")
cursor=cnxn.cursor()
cursor.execute("select * from t_v01")
s = 'sss'
f = 'fff'
cursor.execute("select * from t_v01 where t_id = ? ",[s,]) 
#works good (above)

cursor.execute("insert into t_v01 (t_id,t_type) values (?,?)",[(s,f,),] ) 

给出提到的错误:pyodbc.ProgrammingError: ('HY000', 'The SQL contains 0 parameter markers,..

但是在前面的步骤中,Python 看到了参数标记“?”。为什么?

4

0 回答 0