Python Forum
Add a stored procedure with variable using MySQL Connector
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add a stored procedure with variable using MySQL Connector
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with writing monitored data to mysql upon change of one particular variable donottrackmymetadata 3 191 Yesterday, 09:55 PM
Last Post: deanhystad
  python script is hanging while calling a procedure in database prasanthi417 4 503 Jan-17-2024, 02:33 PM
Last Post: deanhystad
  Mysql and mysql.connector error lostintime 2 665 Oct-03-2023, 10:25 PM
Last Post: lostintime
  python call stored procedure mg24 2 1,071 Oct-18-2022, 02:19 AM
Last Post: mg24
  python call stored procedure with two parameter mg24 4 1,496 Sep-27-2022, 05:02 AM
Last Post: deanhystad
  Mysql error message: Lost connection to MySQL server during query tomtom 6 15,998 Feb-09-2022, 09:55 AM
Last Post: ibreeden
Question Debian 11 Bullseye | Python 3.9.x | pip install mysql-connector-python-rf problems BrandonKastning 4 6,670 Feb-05-2022, 08:25 PM
Last Post: BrandonKastning
  mysql.connector.errors.ProgrammingError: Failed processing format-parameters; Python ilknurg 3 5,592 Jan-18-2022, 06:25 PM
Last Post: ilknurg
  Program stuck at mysql.connector.connect zazas321 1 2,077 Jul-29-2021, 10:49 AM
Last Post: zazas321
  MYSQL.CONNECTOR ERROR DB1 8 3,832 Jul-23-2021, 03:31 AM
Last Post: DB1

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020