"Craig Smith" <cr...@macscripter.net> wrote in
message news:5d97aa0a-73c0-4b2c-83e7-dd7cef798...@macscripter.net
> Alexey, thank you very much for your idea to put a CONSTRAINT on the
> table in the first place, that is the trick for a long term solution.
> Here is how I have put it together:
>
> CREATE TABLE talks (member_id INTEGER, date DATE, CONSTRAINT
> constraint_ignore_dup UNIQUE (member_id, date) ON CONFLICT IGNORE);
>
> I believe that I understand this statement, except for the term
> constraint_ignore_dup.  Is that a variable name?  Could it be pretty
> much anything I want, and if so, what is its purpose?

It's optional. You can write simply

CREATE TABLE talks (member_id INTEGER, date DATE,
    UNIQUE (member_id, date) ON CONFLICT IGNORE);

In some other DBMS'es, constraint name may be used in DROP CONSTRAINT 
statement. But SQLite doesn't support that, so naming a constraint is 
pointless. SQLite supports CONSTRAINT keyword only to ease porting from 
other systems.

Igor Tandetnik



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

Reply via email to