Good morning to all
I Have 2 blocks master and detail
1'st Block has field (Installment_number)
2'nd block is detail is tubular
I need to prevent to create records Greater than the number inserted in (Installment_number s)
I write trigger to get count of rows and compare with (Installment_ number s) and made save when new record instance
But it not prevent create records greater than the (Installment_ number s)
What is the solution or suitable Trigger?
I used triggers :
When create record
When new record_instance
But it is not work ??
Trigeer
declare
cursor c_new_recored is
select count(*)
from STD_TAKISAT_STUD_DETIAL
where
user_stud_id=:STD_TAKISAT_STUD.USER_STUD_ID
and TKSAIT_ID=:STD_TAKISAT_STUD.TKSAIT_ID;
v_new_recored number(1);
begin
commit_form;
open c_new_recored;
fetch c_new_recored into v_new_recored;
If v_new_recored>:STD_TAKISAT_STUD.APPROVER_NUMBER then
RAISE form_trigger_failure;
message ('??E C? ???? ?II C?C??C? ??C? ???I C????? C??C?');
message ('??E C? ???? ?II C?C??C? ??C? ???I C????? C??C?');
RAISE form_trigger_failure;
end if;
close c_new_recored;
Regards
Ibrahim