SQLite Forum

Syntax Error - Why?
Login

Syntax Error - Why?

(1) By anonymous on 2021-01-11 13:59:33 [link] [source]

sqlite> insert into tblaplwincf (name)values('aa') where (select changes()=0);
Error: near "where": syntax error

(2) By Richard Hipp (drh) on 2021-01-11 14:04:18 in reply to 1 [source]

Because the INSERT syntax diagram does not support a WHERE clause. Putting a WHERE clause on an INSERT is therefore a syntax error.

(3) By Mark Lawrence (mark) on 2021-01-11 14:07:17 in reply to 1 [link] [source]

Perhaps what you are trying to do is actually the following:

INSERT INTO tblaplwincf(name)
SELECT 'aa'
WHERE changes() = 0;

(4.1) By Bill Wade (wwade) on 2021-01-11 14:26:42 edited from 4.0 in reply to 1 [link] [source]

Deleted