[HSQLDB]违反唯一约束

时间:2015-07-05 18:27:43

标签: java sql jdbc hsqldb

这是我的HSQLDB脚本

    CREATE SCHEMA PUBLIC AUTHORIZATION DBA
    CREATE MEMORY TABLE destinations (dID INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, country VARCHAR(50), city VARCHAR(50))
    GRANT DBA TO SA
    SET WRITE_DELAY 20
    SET SCHEMA PUBLIC
    INSERT INTO destinations (dID, country, city) VALUES (100,  'Canada', 'Winnipeg')

使用上述脚本可以正常工作。但如果我想用

添加更多脚本
    INSERT INTO destinations (dI,Dcountry, city) VALUES (200,'Canada', 'Vancouvar')

它给错误说

org.hsqldb.HsqlException: Violation of unique constraint SYS_PK_49: duplicate value(s) for column(s) DID

我花了几天时间来处理这个错误并且无法找出原因。任何帮助将不胜感激!

0 个答案:

没有答案