Python sqlalchemy calling stored procedure

Viewed 3803

I am trying to call a stored procedure from python using sqlalchemy. The code I have is as follows:

@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)

I get the following error: AttributeError: 'pyodbc.Connection' object has no attribute 'callproc'

I followed the instructions on the official documentation but that did not make a difference.

I am on python 3.5

Is there a different way to call stored procedures?

1 Answers
Related