title: error: 1318 Incorrect number of arguments for PROCEDURE | Flask
body: <p>I am getting this error message. It only works when <strong><code>_query</code></strong> has single character. Other wise throws and error message. I am using <strong>MySQL extension</strong> for <strong>Flask</strong>.</p>
  
  <blockquote>
    <p>{
    error: "(1318, 'Incorrect number of arguments for PROCEDURE alexspider.SearchStore; expected 1, got 2')"
    }</p>
  </blockquote>
  
  <p><strong>MySQL Procedure:</strong></p>
  
  <pre><code>DELIMITER $$
  CREATE PROCEDURE SearchStore(
   IN Keyword VARCHAR(50))
  BEGIN
   SELECT * 
   FROM noones
   WHERE name LIKE CONCAT('%', Keyword, '%');
  END$$
  DELIMITER ;
  </code></pre>
  
  <hr>
  
  <p><strong>Flask app.py</strong></p>
  
  <pre><code>@app.route('/search', methods=['POST'])
  def search():
      try:
          # Read the posted values from the UI
          _query = request.form['query']
  
          # Validationg the search Quoey
          if _query:
              conn = mysql.connect()
              cursor = conn.cursor()
              cursor.callproc('SearchStore', _query)
              stores = cursor.fetchall()
              if len(stores) &gt; 0:
                  stores_dict = []
                  for store in stores:
                      store_dict  ={
                      'name': store[2],
                      'url': store[3],
                      'cashback': store[4]}
                      stores_dict.append(store_dict)
                  return json.dumps(stores_dict)
              else:
                  return render_template('error.hml', error = 'This is error message')
  
      except Exception as e:
          return json.dumps({'error': str(e)})
      finally:
          cursor.close()
          conn.close()
  </code></pre>