Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

callproc() with parameter doesnt return resultset (no replies)

$
0
0
I have this simple stored procedure which return resultset

CREATE PROCEDURE spGetProductList()
BEGIN
SELECT ProductName, UnitPrice, UnitsInStock FROM products;
END

When I use callproc() to call these stored procedure, it work fine

h=csr.callproc('spGetProductList')

for result in csr.stored_results():
print (result.fetchall())

But If I add a parameter to stored procedure, it doesnt work

CREATE PROCEDURE spGetProductList( qCategoryId INT)
BEGIN
SELECT ProductName, UnitPrice, UnitsInStock
FROM products
WHERE CategoryId=qCategoryId;
END

I use this code to call these stored procedure, no resultset is returned

args = (2,)
h=csr.callproc('spGetProductList', args)

for result in csr.stored_results():
print (result.fetchall())

Viewing all articles
Browse latest Browse all 384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>