pandas read_sql with parameters and wildcard operator
<p>I am trying to retrieve data from sql through python with the code:</p>

<pre><code>query = ("SELECT stuff FROM TABLE WHERE name like %%(this_name)s%")
result = pd.read_sql(query,con=cnx,params={'this_name':some_name})
</code></pre>

<p>The code above works perfectly when I don't have to pass the wildcard operator %.
However, in this case the code doesn't work. How can I pass in the query the wildcard operator? Thank you.</p>

<p>Consider concatenating the wildcard operator, <code>%</code>, to passed in value:</p>

<pre><code>query = ("SELECT stuff FROM TABLE WHERE name LIKE %(this_name)s") 
result = pd.read_sql(query,con=cnx, params={'this_name': '%'+ some_name +'%'})
</code></pre>

python sql pandas wildcard