Home » Developer & Programmer » Forms » when-validate-item
when-validate-item [message #419697] Tue, 25 August 2009 04:06 Go to next message
simcky
Messages: 38
Registered: July 2009
Member
hello to all
guy's i m writing this when-validate-item trigger:-

declare
cursor c is select distinct payperiod from tatrans
where empno=:tatrans.empno;
v varchar2(6);
n number;
begin
open c;
loop
fetch c into v;
if v=:tatrans.payperiod
then
n:=show_alert('alert114');
exit when c%notfound;
end if;
end loop;
end;

this trigger is working but what i want is that if the alert exists then my cursor should
get trapped into the payperiod item until the user cancel's the value or change it
please tell me how could i do this
please help me

[Updated on: Tue, 25 August 2009 04:13]

Report message to a moderator

Re: when-validate-item [message #419717 is a reply to message #419697] Tue, 25 August 2009 05:31 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
raise form_trigger_failure.

And you don't need a loop for this - just add the if check as a where clause in the cursor.
Re: when-validate-item [message #419719 is a reply to message #419717] Tue, 25 August 2009 05:38 Go to previous messageGo to next message
simcky
Messages: 38
Registered: July 2009
Member
hello sir
thanks for the help.

but actually i m not getting the idea of what you are saying could you please explain this little bit more
you don't need a loop for this - just add the if check as a where clause in the cursor.
Re: when-validate-item [message #419730 is a reply to message #419697] Tue, 25 August 2009 06:26 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
I would have thought that was fairly obvious - you're checking if the payperiod in the datablock matches the payperiod in the database table - add that check to the where clause.
Then you can just open, fetch, close instead of looping.
Re: when-validate-item [message #419731 is a reply to message #419730] Tue, 25 August 2009 06:41 Go to previous message
simcky
Messages: 38
Registered: July 2009
Member
thanks for the explanation sir now i got it i think this concept will solve my problem
thanks a lot Mr.Cookiemonster
Previous Topic: Cannot compile form on unix. Error - identifier 'CHECK_COMMIT' must be declared
Next Topic: migration from oracle 9i forms to oracle 10g forms
Goto Forum:
  


Current Time: Fri Sep 20 06:42:58 CDT 2024