views:

230

answers:

1

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?

+3  A: 

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.

bogertron
Yeah, SQL Server 2005 definitely doesn't support that functionality- much to my chagrin.
OMG Ponies
yup, just saw that, thanks: Views are read-only in SQLite. http://www.sqlite.org/lang_createview.html
Tommy
PostgreSQL has it too http://www.postgresql.org/docs/8.4/interactive/sql-createview.html
devio