On 12 March 2012 15:49, Bryce Lembke <bry...@vpieng.com> wrote:
> I cannot seem to get the UNIQUE constraint to work in sqlite.
>
> The following is the trace from my command line.
>
> Note that if I remove the UNIQUE constraint, it works fine.
>
> C:\>sqlite myDB.db
>
> SQLite version 3.6.17
>
> Enter ".help" for instructions
>
> Enter SQL statements terminated with a ";"
>
> sqlite> CREATE TABLE employees (id INTEGER PRIMARY KEY,name TEXT
> UNIQUE);
>
> SQL error: SQL logic error or missing database
>
> sqlite> CREATE TABLE employees (id INTEGER PRIMARY KEY,name TEXT);
>
> sqlite>
>
> The examples I have seen are using this syntax, what am I doing wrong?
>
> Bryce
>

I have just tried your table create statement in versions 3.3.14 and
3.7.10 on Win7; in both cases no error

SQLite version 3.3.14
Enter ".help" for instructions
sqlite> CREATE TABLE employees (id INTEGER PRIMARY KEY,name TEXT UNIQUE);
sqlite>

Where does your shell come from? What environment?

Regards,
Simon
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to