Skip navigation links

MySQL Forums :: Connector/Python :: callproc() with parameter doesnt return resultset


Advanced Search

callproc() with parameter doesnt return resultset
Posted by: Privida Kristiono ()
Date: November 07, 2012 05:34AM

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

Options: ReplyQuote


Subject Written By Posted
callproc() with parameter doesnt return resultset Privida Kristiono 11/07/2012 05:34AM
Re: callproc() with parameter doesnt return resultset Geert Vanderkelen 11/27/2012 04:02AM
Re: callproc() with parameter doesnt return resultset Privida Kristiono 12/02/2012 08:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.