Trying to update a table view using:
CREATE OR REPLACE VIEW [vtable] AS SELECT * FROM Files_Table ORDER BY File
The table is returning the old view, not the updated.
Statement tested in the Sqlite database browser:
Error message from database engine: near "OR": syntax error
but didn't get this in the program?
Any idea why it's not updating?
SQLite does not support the CREATE OR REPLACE syntax. The only database that I know which supports that syntax is Oracle, but I am guessing there are others.
Drop the view and create it with the new definition:
DROP VIEW IF EXISTS [vtable]; -- "OR REPLACE"
CREATE VIEW [vtable] AS SELECT * FROM Files_Table ORDER BY File;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With