On June 11, rick wrote:
Something I noticed today:
sqlite> select * FROM words WHERE word = "id";
<nothing>
sqlite> select * FROM words WHERE word = 'id';
13556|id
sqlite> .schema
CREATE TABLE words (
id integer primary key,
word varchar(64)
);
Yes, it can be explained: <http://www.sqlite.org/lang_keywords.html> says:
'keyword' A keyword in single quotes is a string literal.
"keyword" A keyword in double-quotes is an identifier
So, "id" is interpreted as a column name, not as the string literal 'id',
unless the value in the double quotes is not an identifier (column name).
I think this is quite nasty behaviour. Hope it prevents someone making the
same mistake!
You should take up the nastiness issue with the authors of the SQL-92
standard and its successors. Supporting the convention you just noticed
is the least surprising behavior for those who have learned SQL as
defined, and hence is not generally regarded as a nasty feature.
Good luck.
--
Larry Brasfield
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users