SirCharles
Programmer
I'd like to update a unique field, field_unique, based on incoming value of another field, field_not_unique.
Ideally a unique index on the field_unique field and a trigger to trap an on_dup_val:
create or replace trigger table_name_field_biu
before insert or update
on table_name
for each row
declare
begin
:new.field_unique := :new.field_not_unique;
exception
when others then
:new.field_unique := :new.field_not_unique||field_pk;
end;
/
Problem is that unique index on field_unique throws exception that does not appear to be trapped in this trigger.
Any ideas?
Ideally a unique index on the field_unique field and a trigger to trap an on_dup_val:
create or replace trigger table_name_field_biu
before insert or update
on table_name
for each row
declare
begin
:new.field_unique := :new.field_not_unique;
exception
when others then
:new.field_unique := :new.field_not_unique||field_pk;
end;
/
Problem is that unique index on field_unique throws exception that does not appear to be trapped in this trigger.
Any ideas?