Passing Parameters to Stored Procedures using PyODBC

做~自己de王妃 提交于 2019-12-01 11:03:35

I finally got it, to work without crashing

local_cursor.execute("{call dbo.GetAlarmEventHistoryFrequency_TimeRange(tstart,tend)}")

is the wrong syntax. It should be

local_cursor.execute("{call dbo.GetAlarmEventHistoryFrequency_TimeRange(?,?)}",(tstart),(tend))

Special attention should be made to the special symbols {} and the way the parameters are passed in (tstart),(tend) local_cursor.execute("*{*call dbo.GetAlarmEventHistoryFrequency_TimeRange*(?,?)}",(tstart),(tend)*)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!