Nicolas Williams <[EMAIL PROTECTED]> wrote: > On Fri, Sep 05, 2008 at 09:31:43PM +0200, Andreas Ntaflos wrote: >> In the Room table the primary key is a combination of two >> attributes. How could I auto-increment the roomID? "roomID INTEGER >> AUTOINCREMENT" is syntactically incorrect and the AUTOINCREMENT >> keyword seems to cannot appear anywhere else. >> >> What is the SQLite-way to auto-increment when the AUTOINCREMENT >> keyword is not available? > > I think you should make the roomID the primary key, and autoincrement, > then create a UNIQUE INDEX for the Room table on the roomID and > buildingID columns.
If roomID is already unique by itself, an index on (roomID, buildingID) is rather pointless. There can't be two records with the same (roomID, buildingID) because that would require two recors with the same roomID. Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users