According to my Terminal, I inserted values in my database succesfully.
I used : db.execute(“…”)
But the table in the database does not contain those values.
They are set NULL but initally they are not.
app = Flask(name)
app.config[“SESSION_PERMANENT”] = False
app.config[“SESSION_TYPE”] = “filesystem”
Session(app)
db=SQL(“sqlite:///name.db”)
I tried to do the NOT NULL in the database but I want to insert values with different statements:
db.execute(“INSERT INTO a SELECT DISTINCT b * :c WHERE d=:e”,e=f)
db.execute(“INSERT INTO a g VALUES (h)”)
I do those statement multiple times with different values. I tried to put them in one execute statement but it does not work. Maybe I have done it wrong.
I did it like: INSERT INTO a (g,…)SELECT DISTINCT(b * :f, …) VALUES (h,…)
I tried a .commit statement but it does not work.
When I trie to do it with sqlalchemy, I cannnot import flask_sqlalchemy from SQLAlchemy.