【发布时间】:2018-01-10 05:46:43
【问题描述】:
我正在尝试使用sqlalchemy 从python 调用stored procedure。我的代码如下:
@database_connection_wrapper
def get_adv(connection):
''' get the adv using a stored proc from the database '''
connection.callproc("GetAdvMedianTrailing30Days")
results = list(connection.fetchall())
print(results)
我收到以下错误:
AttributeError: 'pyodbc.Connection' object has no attribute 'callproc'
我按照官方文档上的说明进行操作,但这并没有什么不同。
我在python 3.5
有没有其他方式可以拨打stored procedures?
【问题讨论】:
标签: python python-3.x sqlalchemy pyodbc