Error "Previous SQL was not a query" in Python?
<p>I am trying to call a stored procedure in Python but it keeps giving me the following error. The  procedure is written in SQL Server 2008 and I am using PyODBC to call the method and pass parameters to it.</p>

<pre><code>import pyodbc
cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER='+serveripaddr+';DATABASE='+database+';UID='+userid+';PWD='+password+'')
cursor = cnxn.cursor()
cursor.execute("{call p_GetTransactionsStats('KENYA', '41')}")
rows = cursor.fetchall()
</code></pre>

<p>The last line results in the following exception:</p>

<pre><code>ProgrammingError: No results.  Previous SQL was not a query.
</code></pre>

<p>What could be the problem here?</p>