[英]unsupported format character ''' (0x27) at index while passing parameter as well as using wildcard in query
i am facing an issue in python where i am using a query and i am passing some params in it:我在 python 中遇到一个问题,我正在使用查询并且我在其中传递了一些参数:
query = select * from %s where xyz like 'abc%'
query %(tablename)
here it gives me an error.在这里它给了我一个错误。 Can anyone help in this
任何人都可以在这方面提供帮助
It looks like python is interpreting the % as a printf-like format character.看起来 python 将 % 解释为类似 printf 的格式字符。 Try using %%?
试试用%%?
query = select * from %s where xyz like 'abc%%'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.