Skip to content
Advertisement

Python inserts only One row on a SQLite DB

Why my code only inserts one line?

Advertisement

Answer

Avoid the loop and run one INSERT INTO ... SELECT query. Right now you re-use same cursor outside and inside loop causing issues with processing. Either use two different cursors or efficiently combine and have database engine run action query:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement