Found the following trigger in a database which was blocking inserts on a unique varchar primary key
CREATE OR REPLACE TRIGGER "BI_PRIVILEGE"
before insert on "PRIVILEGE"
for each row
begin
if :NEW."PRIVILEGE-ID" is null then
select "PRIVILEGE_SEQ".nextval into :NEW."PRIVILEGE-ID" from dual;
end if;
end;
Is this an auto-number generator? I can easily disable it to fix my problem, but will there be unforseen negative ramifcations for the primary key?
I have actually been looking for code to set up auto-increment triggers for primary keys and could use this as a template if this is what it is doing. If it is, it is likely doing it incorrectly as the primary key is specifically PRIVILEGE_ID
not PRIVILEGE-ID
, also, shouldn't some sort of application_error
arise in the case of conflicts, etc?