从Django的参数调用存储过程

我在mssql spGetRowRackInfo中有一个存储过程, 我正在我的Django应用程序中调用该过程(使用pyodbc)

URL模式:

urlpatterns = [
path('ReportRacks/',views.ReportRacks,name="ReportRacks"),]

代码:

id = request.GET["ID"]
Type = request.GET["Type"]
cursor = connection.cursor()
cursor.execute("{call dbo.spGetRowRackInfo(?,?)}",[id,Type])

遇到错误:

ERR sql = sql % tuple('?' * len(params))
ERR TypeError: not all arguments converted during string formatting

我该如何解决?

xiao5210110 回答:从Django的参数调用存储过程

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3158984.html

大家都在问