Quantcast
Channel: Idiomatic way to construct a SQL INSERT query in Python - Code Review Stack Exchange
Browsing latest articles
Browse All 3 View Live

Answer by moooeeeep for Idiomatic way to construct a SQL INSERT query in Python

The even better way to insert many records, is to use cursor.executemany() instead. You did not state what API you use, but AFAIK at least the libraries commonly used with PostgreSQL, MySQL and SQLite...

View Article



Answer by BeetDemGuise for Idiomatic way to construct a SQL INSERT query in...

There is a neater, more Pythonic way of doing this using the str.format function. However, it is not the way you should do it. Currently, the way you are building your query, you are vulnerable to SQL...

View Article

Idiomatic way to construct a SQL INSERT query in Python

I have a bit of code to insert some values in a table. It seems a bit clunky - is there a neater way?words is a list of dictionaries, and the entries contain other fields which I don't want to insert.#...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images