本文介绍了是什么?python pyodbc 模块中的意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
import pyodbc
cursor.execute("INSERT INTO Testing_Param(Seed_Number,Cycle_Name) VALUES (?,?)",('0','CoupleIn'))
什么是?"在代码中是什么意思?当我尝试更换 ?%s 表示字符串CoupleIn",%d 表示0",为什么会出现错误信息:
what does the "?" mean in the code? When I try to replace the ? to %s for the "CoupleIn" which is the string and %d for the "0", why does it appear error message:
pyodbc.ProgrammingError: ('SQL 包含 0 个参数标记,但提供了 2 个参数', 'HY000')
我是 pyodbc 模块的新手,用于将数据从 Python 传输到 Microsoft SQL 服务器
I am new to the pyodbc module to do transfering data from Python into Microsoft SQL server
推荐答案它是参数值的占位符,'0' 和 'Couple'.cursor.execute 将替换 ?s 的值.
It is a place holder for parameter values, '0' and 'Couple'. cursor.execute will substitute the values in place of ?s.
更多推荐
是什么?python pyodbc 模块中的意思
发布评论