Open miguelbento opened 4 years ago
By default, JinjaSQL converts your query to a string with %s
. So a query like SELECT * from users where name = {{params.firstName}}
becomes SELECT * from users where name = %s
. When you have a literal string with a %s
as part of a like query, the underlying database driver gets confused.
You have two ways to solve this problem:
column like '%sblah%s'
, write it with two %
symbols, like column like %%blah%%
. That should solve your problem.?
. If you end up changing to ?
, and your query has a literal ?
in it, you would then have to escape it. I guess % is more likely in a query, so it perhaps makes sense to change the format to qmark.
Hi there,
Firstly thank you for a really useful package!
I've tried a number of queries and they all worked until I used a query that uses LIKE statements in the SQL to check for phrases in text fields. The use of the % sign and 'S' is causing an error - perhaps its being resolved to something else in the code? Please see example below. When I change the %SNB% to something else (eg. %FNB%), I get a different error. Please assist :)
query being executed: select count(1) from