Reputation: 11
I am trying to pass a string which has a '%' in it (its actually a sql query string). How do I pass the % (do I have to use a specific escape character?
eg: compute_answertime("%how do I%")
Upvotes: 1
Views: 194
Reputation: 24652
You can use:
%%; DROP TABLE Students; --
Sorry, couldn't resist.
Upvotes: 1
Reputation: 29913
Use another %
to escape it
>>> compute_answertime("%%how do I%%")
Upvotes: 4