我运行pyodbc连接到我的数据库,当我运行一个简单的查询时,我会得到一堆结果,比如
(7L, )(12L,) etc.
如何用“”替换“L”,以便将ID传递到另一个查询中
谢谢
这是我的密码
import pyodbc
cnxn = pyodbc.connect('DSN=...;UID=...;PWD=...', ansi=True)
cursor = cnxn.cursor()
rows = cursor.execute("select id from orders")
for row in rows:
test = cursor.execute("select name from customer where order_id = %(id)s" %{'id':row})
print test
使用parameters:
数字后面的
L
表示该值是long类型。你知道吗相关问题 更多 >
编程相关推荐