You can name your constraints, so you know which failed.
Examples:
Without named constraint:
-- SQLite version 3.9.2 [ Release: 2015-11-02 ] on SQLitespeed
version 2.0.2.4.
--
================================================================================================
CREATE TABLE `a` (
`b` INTEGER CHECK(typeof(`b`) = 'integer')
);
INSERT INTO a VALUES ('string');
-- 2016-11-15 14:08:07.779 | [ERROR] CHECK constraint failed: a
--
------------------------------------------------------------------------------------------------
With named constraint:
-- SQLite version 3.9.2 [ Release: 2015-11-02 ] on SQLitespeed
version 2.0.2.4.
--
================================================================================================
CREATE TABLE `a` (
`b` INTEGER,
CONSTRAINT b_Chk CHECK(typeof(`b`) = 'integer')
);
INSERT INTO a VALUES ('string');
-- 2016-11-15 14:10:40.535 | [ERROR] CHECK constraint failed:
b_Chk
--
------------------------------------------------------------------------------------------------
On 2016/11/14 1:49 PM, Api DupCheck wrote:
Hi,
CREATE TABLE `a` (`b` INTEGER CHECK(typeof(`b`) = 'integer'));
INSERT INTO a VALUES ('string');
CHECK constraint failed: a
But it should print:
CHECK constraint failed: a.b
Because if there are a lot fields how do a developer know on which field
CHECK failed?
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users