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