When issuing an INSERT statement in Python, no such column is displayed

When I issue an INSERT statement in Python, the error no such column is displayed and it becomes "??".

When I try to display SQL on the console screen using print ...

** INSERT INTO license (license_nm) values (Basic Information Technology Engineer Examination) **

Apparently there was no single quote, so there was an error ...

■ The code in question

#Insert data sql = "INSERT INTO license (license_nm) values " sql += "(" sql += in_shikaku sql += ")"


■ Modified code

#Insert data sql = "INSERT INTO license (license_nm) values " sql += "(" sql += "'" + in_shikaku + "'" sql += ")"


It was a rudimentary mistake ...

I don't want to enclose it in "'" one by one, so I have to do something about the DB issuance process ...

Recommended Posts

When issuing an INSERT statement in Python, no such column is displayed
When "No changes detected" is displayed in python3 manage.py makemigrations
In python + sqlite3 "OperationalError: no such column:"
There is no switch in python
Python in is also an operator
How to write what to do when an application is first displayed in Qt for Python with Designer
Generate an insert statement from CSV with Python.
What to do when [Errno 2] No such file or directory appears in Python
Solution when module'XXX' has no attribute'XXX' in Python
Insert an object inside a string in Python
When you get an error in python scraping (requests)
When "ERROR: HTTP is not supported." Is displayed in mpsyt
When converting a string (a-> b) in Python, which is faster, if statement or dictionary type?
[Python] How to write an if statement in one sentence.
Grayscale image is displayed as a color image in OpenCV / Python
Quicksort an array in Python 3
[Python] Insert ":" in MAC address
Resolved an error when putting pygame in python3 on raspberry pi
I got an AttributeError when mocking the open method in python
[Python] Execution time when a function is entered in a dictionary value
The solution when an empty object is returned in go's json.Marshal
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
What to do when the value type is ambiguous in Python?
[Python] Whiten the parts that turn black when there is no data in the Choropleth map of Folium.