Yes. See syntax diagram in http://sqlite.org/lang_createtable.html.

-----Urspr√ľngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von J Decker
Gesendet: Mittwoch, 11. April 2018 19:41
An: General Discussion of SQLite Database <sqlite-users@mailinglists.sqlite.org>
Betreff: [EXTERNAL] [sqlite] Constraints must be defined last?

Is there something about SQL that requires constraints to follow all column 
definitions?


sqlite> create table `option4_blobs` (`option_id` char(36) default '0',
CONSTRAINT `value_id` UNIQUE (`option_id`),`binary` blob, FOREIGN KEY
(`option_id`) REFERENCES `option4_map`(`option_id`)ON UPDATE CASCADE ON DELETE 
CASCADE)
   ...> ;
Error: near "`binary`": syntax error

sqlite> create table `option4_blobs` (`option_id` char(36) default
'0',`binary` blob, CONSTRAINT `value_id` UNIQUE (`option_id`), FOREIGN KEY
(`option_id`) REFERENCES `option4_map`(`option_id`)ON UPDATE CASCADE ON DELETE 
CASCADE)
   ...> ;
-- works
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to