when-validate-item [message #419697] |
Tue, 25 August 2009 04:06 |
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 #419719 is a reply to message #419717] |
Tue, 25 August 2009 05:38 |
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 |
cookiemonster
Messages: 13960 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.
|
|
|
|