SqLite does not support dropping a column. You have to create a copy of the table (along with its data), drop the original table, recreate the original without the column, and copy the data back (minus the column you’re dropping). Many sqlite tools do this for you behind the scenes, but in Xojo you have to do all the work yourself.
You may be right, because I used at first www.w2Schools.com/sql/ information… then when it does not worked, I checked sqlite.org docs (doswnloaded yesterday afternoon).
SQL_Cmd = "ALTER TABLE Spare_Parts DROP COLUMN SRP;"
Get Syntax Error Near DROP.
Previous reports were because a debug line I add yesterday (and forgot since)… sorry.
It looks like the newest versions of sqlite support that syntax, but the version in use by Xojo does not. Xojo uses an older version of sqlite, which does not support that and will throw an error.
And yes, in older versions of the engine we renamed the old table to some temp name, recreated a new table with the new structure, copied the data from temp to the new one, and deleted the temp table.
Thank you, Emile, but how new users, without Xojo installed can know which version of SQLite is part of the released Xojo? Is there a place in the documentation for that?
I can’t find it in the release notes
I can’t find it in the system requirements
I can’t find it in sqlite database documentation for Xojo
I’m used to search in Google for something, like ‘Xojo Sqlite Version’ and find the answer, but can’t find it this time.