Skip to content

Tag: sqlite

Django – fresh database and no such table

I’m using my complex jobs app in production and it works fine, with sqlite database. I’m trying to create new database from scratch and I cannot do that nor using migrations nor trying to make them once again: When I’m trying to reuse my migrations: When I’ve tried to remove all migration files: How can I investigate what is going

Load data from Flask/Python to HTML textarea

I am trying to send data from Python / Flask to an HTML form textarea but need some help. responses.html is shown below. A portion of is shown below: I would like to display any previously recorded responses in the response textarea of responses.html while preserving the placeholder when no previous response was received from the user. Answer I

Run Loop If Value Does Not Exist in Database

#update – I fixed the syntax error moving a ), but it still doesn’t work as intended. Now it runs the loop even with a duplicate, which is not the intent. I’m trying to add a list of quotes to a database, but only if the author doesn’t already exist. I’m getting a syntax error here, and no existing posts

Getting “sqlite3.ProgrammingError: Incorrect number of bindings supplied” when splitting lines from file and inserting into database

I’m trying to import data from a csv file to a existing database, the database has 4 columns called product_id, Firstname, Lastname, Address and this is the code for the csv import; But I keep getting the error sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 4, and there are 1 supplied. What am I doing wrong? Answer

Iterating through records with SQL INSERT activated stops after first set of INSERTS, but using PRINT to test goes through EVERY record (as desired)

Python 3.10.2 with sqlite3 on Windows 10. Relatively new to Python, but I was quite experienced with Perl around 1997-2005. Banged my head against this for three days. Attacked from lots of angles. No success. I’m asking for guidance, because I don’t see myself progressing on my own at this point without help flipping on the light-switch. My overall application

Can repeating query be saved?

In my Python / Sqlite program, I am running queries like this So the “basic” query is the same, and the rows Sqlite gathers are the same, but because of the different grouping , I have to run the same query multiple times. I wonder if there is a way to achieve the same output more effectively, ie. run the