On Thu, 2 Mar 2006, Sripathi Raj wrote:
[...]
Is the IF NOT EXISTS constraint supported? When I try to use it, I get an
error message saying that there is a syntax error at 'NOT'? I'm using Sqlite
3 on Windows and I'm trying to connect to it from Perl.
[...]
Hello,
the information that you are using version 3 is not precise enough to
answer this question with yes or no ;)
I know the IF [NOT] EXISTS syntax is *not* supported in SQLite 3.1.3 but
it *is* supported in SQLite 3.3.4. A quick glance at the changelog says
the syntax was introduced with 3.3.0 alpha.
However I recently ran into the pitfall, that with SQLite 3.3.4 the
compilation of an IF [NOT] EXISTS qualified statement may result in a NULL
statement handle being returned in case the IF [NOT] EXISTS clause does
not apply. If this is a problem for you, you should use the current CVS
version of SQLite3 which has that behaviour fixed.
cu,
Thomas