是什么?python pyodbc 模块中的意思

编程入门 行业动态 更新时间:2024-10-26 05:25:35
本文介绍了是什么?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 模块中的意思

本文发布于:2023-05-27 09:57:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/285750.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模块   python   pyodbc

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!