Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

trigger on oracle forms

tayshaunApr 4 2020 — edited Apr 7 2020

some time ago I published this incident that was happening to me.

I have a problem in a form, which is that I have a pre-insert trigger for when I exceed the quantity, it shows me a message, but when I exceed it, it does not show me any message and it allows me to save the record, and if the amount is exceeded you should not save and show me the message, I've also tried when-validate record and nothing, which help would be appreciated.

declare

v_cant_e    number(5);

v_cant_s    number(5);

v_total     number(5);

begin

begin

    select sum(quantity) into v_cant_e

from     mov

where    cod_mov=:mov.cod_mov

and      codigo_art = :mov.codigo_art

and      signo='+';

exception

when others then

v_cant_e:=0;

end;

begin

    select sum(quantity) into v_cant_s

from     mov

where    cod_mov=:mov.cod_mov

and      codigo_art = :mov.codigo_art

and      signo='-';

exception

when others then

v_cant_s:=0;

end;

v_total:=v_cant_s > v_cant_e them

message('quantity exceeded on Article '||:mov.cod_mov);

message('quantity exceeded on Article '||:mov.cod_mov);

raise form_trigger_failure;

end if;

end;

Comments
Post Details
Added on Apr 4 2020
5 comments
567 views