It may be wise to use āif not existsā to check if such a table already exists, before trying to create itā¦
var datedujour As String = Format(DateTime.Now.Hour,"00")
Var sql as String = "CREATE TABLE " + datedujour + " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, surname TEXT)"
db.ExecuteSQL(sql)
I would advise against creating one table for each day in real time ā¦
better create a fixed table āeventsā with a field named āday_of_monthā where you store the day
then itās a question of filtering the display to select only the day you want.
itās more āintegrity friendlyā
just my 2cts.
var datedujour As String = "table_"+Format(DateTime.Now.Hour,"00") // must start with letters
Var sql as String = "CREATE TABLE " + datedujour + " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, surname TEXT)"
db.ExecuteSQL(sql)
As the user seem not being an expert, I guess you are correct. But things really depends on use case and design. I think that may have some real proper use case like rotating logs being created, and after backup, droppedā¦ But as I said, I guess it is not the current case.
Iāve just realized that you canāt put a number in the name of an SQLite table! If this is true, I find it completely absurd!
Yes, Iām going to go back to a single table with a column named with the day.
Thank you all for your helpā¦