I am confused... I have a file "calculation.py" which contains which contains following code:
conn = sqlite3.connect('matchprediction.db')
c = conn.cursor()
c.execute("SELECT * FROM spielplan WHERE table = 8")
In addition I run that file via the local host in django to simulate a webserver.
Whenever I start the server with python manage.py runserver, I get the error message:
sqlite3.OperationalError: no such table: table
The database definitely exists and the table itself, too. Have checked it with a DB Browser. The calculations.py works, because it retrieves data from this table to execute the calculation. The output result in the run-window is correct.
What am I doing wrong and how may I fix this?
matchprediction.db? Since you're not using an absolute path, it's relative to the working directory of the server, which could be anything.spielplanhas a column namedtable. But in most dialects of SQL,tableis a reserved word (as increate table).