On Mon, Mar 22, 2010 at 01:52:15PM -0500, Bogdan Ureche scratched on the wall: > SQLite seems to accept the following column declaration syntax without > errors: > > CREATE TABLE Test( > TestId INTEGER NULL, > TestName TEXT NULL); > > However, there is no branch in the column constraint > diagram<http://www.sqlite.org/syntaxdiagrams.html#column-constraint> > describing > this syntax. In the NOT NULL branch, the NOT keyword is not optional. Is > this case described on another diagram?
No, but I wouldn't read into that. The syntax diagrams are not meant to be absolute reference as to what the SQLite parser and command engine will or will not accept. There are many instances of both accepted sequences that are not represented in the diagrams (such as this) as well as commands that are legal by the diagrams but not in an actual command (like "xxx NATURAL CROSS JOIN yyy USING (col1)"). When it comes to balancing ease-of-reading with absolute correctness, ease-of-reading usually wins, especially when mixed in with a bit of common sense. If you want to know exactly what will or will not be accepted, look at the parser-- but that's still just half the story. In this case, the NULL seems to be ignored. It is not part of the type (which was my initial guess), nor does it appear to associate with the default value (you can still specify one). -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor." "I'll go home and see if I can scrounge up a ruler and a piece of string." --from Anathem by Neal Stephenson _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

