I get this error when I try to insert new record although I can do the same without errors inside my admin tool.
here is the SQLviolation of PRIMARY or UNIQUE KEY constraint "UNQ1" on table "Table1"
Code: Select all
CREATE TABLE Table1 (
MN_ID INTEGER NOT NULL,
POS SMALLINT NOT NULL
);
ALTER TABLE Table1 ADD CONSTRAINT UNQ1 UNIQUE (MN_ID, POS);
/* Trigger */
CREATE OR ALTER TRIGGER Table1_BI0 FOR Table1
ACTIVE BEFORE INSERT POSITION 0
AS
begin
select max(POS)+1 from table1 where Table1.MN_id = new.mn_id into new.pos;
end
Thanks