pyodbc.ProgrammingError:(' HY000',' SQL包含0个参数标记,

时间:2015-04-30 18:32:29

标签: pyodbc pypyodbc

与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看到了参数标记"?"。为什么呢?

0 个答案:

没有答案