Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

Lpad not supporting %s in Python (no replies)

$
0
0
Hi,

I am trying to query:
cursor.execute("Select Lpad (%s,5,0)", (24))

which results in error:
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s,5,0)' at line 1

Same query executes successfully as:
cursor.execute("Select Lpad (24,5,0)")

Platform: Windows
Lib. Build: mysql-connector-python-2.1.6-py2.7-winx64
Python: 2.7.13

Viewing all articles
Browse latest Browse all 384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>