Error:
When using pymysql, an error occurs when using% d to pass parameters in the SQL statement. As shown in the figure:
Error information: typeerror:% d format: a number is required, not str
Cause of problem:
When a parameter of type int is passed in, it is converted to a parameter of type str. Therefore, the solution is to change% d into% s, pass in int type, and it can still be executed.
Modified:
Data of type int passed in:
Can execute successfully
Solution:
When data of type int is passed in, the parameter is still passed with% s.
Read More:
- Pass parameters to the YML file, ansible playbook command
- Mybatis passes in multiple parameters to mapper. And uses @param details to report an error
- An error keyerror255 was reported when pymysql connect to MySQL
- An error 1064 is reported when pymysql accesses the image
- After verifying parameters with validation, springboot reports an error: no constructor found in package name + class name
- Python common error: if using all scalar values, you must pass an index (four solutions)
- An error related to field none type occurs when allennlp executes the train
- An error occurs when es logstash is installed and running
- To solve the problem that fastcgi process often fails recently, an unknown fastcgi error occurs
- An error occurs when cartopy library uses the coastlines() command
- Four ways to get Django parameters in request
- The problem of failed to create process occurs in pyinstaller package program of Python
- An error occurs when HBase uses the shell command: pleaseholdexception: Master is initializing solution
- When installing mysql, an error occurs when executing the installation command with the CMD window. Install / Remove of the Service denied
- Solve the problem of error: cannot pass objects of non trivially copyable type ‘STD:: String’ in C / C + +
- Create an Apex class that returns contacts based on incoming parameters
- An error occurs when superstet connects to the Clickhouse database: error: could not load database driver: Clickhouse
- #error identifier-list parameters may only be used in a function definition
- class.getResource () and ClassLoader.getResource How to fill in the parameters in ()
- Vue calculates attributes and passes parameters to the computed method