title: PYODBC does not like %, "The SQL contains 2 parameter markers, but 1 parameters were supplied."
body: <p>So I'm currently linking Python with SQL to pull out customer information. Unfortunately, I'm getting some errors with regards to SQL. I am trying to use the LIKE operator, and the % wildcard, but I keep getting errors because Python does not like %. As a result, it pretends that variable between the %s do not exist. Here's what I mean:</p>
  
  <pre><code>SELECT custnbr,
         firstname,
         middleint,
         lastname
  FROM   lqppcusmst
  WHERE  custnbr = ?  AND firstname LIKE ? 
  </code></pre>
  
  <p>Right now, I'm just testing it out, so I'm just using the customer number, and the first name. I give it a value:</p>
  
  <pre><code>remote_system_account_number = request.DATA['remote_system_account_number']
  remote_system_first_name = request.DATA['remote_system_first_name']
  </code></pre>
  
  <p>Since what I'm writing is for searching customers within the database, there's a chance there could be blank entries, so I have it like such:</p>
  
  <pre><code>if remote_system_account_number != '':
      SQL_where += ' custnbr = ? '
      parameters += "remote_system_account_number"
  if remote_system_first_name != '':
      SQL_where += ' AND firstname LIKE ? '
      parameters += ", %remote_system_first_name%"
  </code></pre>
  
  <p>So I thought this would work, but it didn't. When I execute it like such:</p>
  
  <pre><code>database_cursor.execute(customer_information_SQLString + SQL_where, parameters)
  </code></pre>
  
  <p>I get this:</p>
  
  <pre><code>ProgrammingError: ('The SQL contains 2 parameter markers, but 1 parameters were supplied', 'HY000')
  </code></pre>
  
  <p>Anyone know how to deal with this?</p>