Python Forum
Add a stored procedure with variable using MySQL Connector - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Add a stored procedure with variable using MySQL Connector (/thread-18072.html)



Add a stored procedure with variable using MySQL Connector - UtiliseIT - May-04-2019

Hi, Im using the Python MySQL Connector to fire a stored procedure with a variable.

Thanks to the awesome help in this forum my working version of an insert is

query = ("SELECT distinctrow UPC, ItemFriendlyNames, ItemName, Brand, Model, Retailer, ItemID FROM my.view where ItemFriendlyNames like "%(pSearch)%" order by UPC, Model, Retailer")
data = (event['pSearch'],)
         
cursor.execute(query,data)
rows = cursor.fetchall()
What I need to do is fire stored procedure sp_showitemswithSearch that recieves an input called pSearchTerm

Ive tried to format based on the select query and also tried callproc but can't quite seem to get either format right.

Thanks in advance

Todd