Check application constraint with trigger
Hi,
Before inserting a new line in a table, I want to check if some columns values from that insert (on 2 columns and for only one type of value for one of these 2 columns) already exists in that table, and if so reject the insert. It's like a unique constraint but only on some couple values, not all values, so I can't use a unique constraint.
For exemple, I have the test table : test(c1 number(2) primary key, c2 varchar(10), c3 varcher(10)).
I don't want duplicate rows on columns c2 and c3 but only when c3 value is '1' !