Re: [sqlite] Different error messages for the same syntax error
Please ignore the previous reply, I see your concern is not the error message but indeed the difference in messages for what seems to be a similar error (knowingly so). On 2016/07/04 8:21 PM, gwenn wrote: Hello, SQLite version 3.13.0 2016-05-18 10:57:30 sqlite> create table test (name text default ''); sqlite> insert into test values (); Error: near ")": syntax error sqlite> insert into test values (''), (); Error: no tables specified Maybe the parser rule is too permissive: values(A) ::= values(X) COMMA LP exprlist(Y) RP. versus values(A) ::= values(X) COMMA LP nexprlist(Y) RP. Thanks and regards. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Different error messages for the same syntax error
On 2016/07/04 8:21 PM, gwenn wrote: Hello, SQLite version 3.13.0 2016-05-18 10:57:30 sqlite> create table test (name text default ''); sqlite> insert into test values (); Error: near ")": syntax error sqlite> insert into test values (''), (); Error: no tables specified The documentation is clear on this matter I think - It says that if a field-list is not specified, the inserted VALUES must be exactly the number of fields in the table. If the prototype field-list is specified, you may omit one or more of the fields (but not all of them) and the omitted fields will gain their specified default values or NULL where no default is specified. Inserting such a null into a NOT NULL column will be a constraint violation. The above Insert statements do not conform to this documented requirement. To comply, you /must/ specify one of: INSERT INTO test (name) VALUES ('') or INSERT INTO test VALUES ('') or INSERT INTO test DEFAULTS - All of which should work. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Different error messages for the same syntax error
insert into table test defaults; On Mon, Jul 4, 2016 at 2:21 PM, gwennwrote: > Hello, > > SQLite version 3.13.0 2016-05-18 10:57:30 > sqlite> create table test (name text default ''); > sqlite> insert into test values (); > Error: near ")": syntax error > sqlite> insert into test values (''), (); > Error: no tables specified > > Maybe the parser rule is too permissive: > values(A) ::= values(X) COMMA LP exprlist(Y) RP. > versus > values(A) ::= values(X) COMMA LP nexprlist(Y) RP. > > Thanks and regards. > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Different error messages for the same syntax error
Hello, SQLite version 3.13.0 2016-05-18 10:57:30 sqlite> create table test (name text default ''); sqlite> insert into test values (); Error: near ")": syntax error sqlite> insert into test values (''), (); Error: no tables specified Maybe the parser rule is too permissive: values(A) ::= values(X) COMMA LP exprlist(Y) RP. versus values(A) ::= values(X) COMMA LP nexprlist(Y) RP. Thanks and regards. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users