SQLite Forum

DROP VIEW IF EXISTS failure
Login
> How should one check if a view is actually a view with pure SQL only? 

Without consulting `sqlite_master`, you can't determine, using only SQL, and without potentially generating an SQL error, the nature of *any* construct, be it a table, view, index, or a function.

> it has the severe side effect of canceling the whole stack and requiring me to find out where the error arose

The alternative which you're implying is that no error be generated and the presumably up-coming `create view` fails instead because there's a table with that name. Either way, it fails. In general it's preferable for software to fail earlier than later.

As Larry pointed out, this sounds very much like a one-time problem which has simply struck a nerve for you, not a recurring thing which is a frequent/recurring hindrance. You fix your (demonstrably incorrect) "whole stack" a single time and it's done.