I have a trigger on my table client of which any client under 16
cannot not be added on an attempt to insert and 'test fail' would be logged into table test_result.
when the opposite is done to table client i.e (client over 16) the values should be inserted and 'test pass' should be logged into table test_result.
The probelem is 'test pass' is logged on and 'test fail' doesn't or at least it is not displayed, I know this because the comment_seq.nextval is used up.
create or replace trigger age_restriction_comment
Before insert on client
For each row
( add_months(:new.age,12*16) >= trunc(sysdate) )
i_comment := 'test fail';
i_comment := 'test pass';
insert into test_result (test_id, comments) values (comment_seq.nextval, i_comment);
below is what my tbl test_result looks like.
1 test pass
4 test pass
6 test pass
8 test pass