PLS-00222 error [message #407722] |
Thu, 11 June 2009 05:12  |
Roger22
Messages: 98 Registered: April 2009 Location: Brasov, ROMANIA
|
Member |
|
|
Hello,
i have a trigger
create or replace trigger trg_aft_insert_salarii
after insert or update on salarii
references old as old new as new for each row
declare
data_min date;
ani_vechime integer;
procent_spor_vechime integer;
spor_vechime sporuri.spvech%type;
begin
select MIN (data_start) into data_min
FROM angajat_functie
WHERE id_angajat=:new.id_angajat
GROUP BY id_angajat;
select ani_vechime(data_min, to_number(to_char(sysdate,'YYYY')), to_number(to_char(sysdate,'MM'))) into ani_vechime from dual;
select procent_spor_vechime(ani_vechime(data_min, to_number(to_char(sysdate,'YYYY')), to_number(to_char(sysdate,'MM'))) ) into procent_spor_vechime from dual;
spor_vechime:= round(:new.venit_baza * procent_spor_vechime/100, -3);
insert into asdd values (ani_vechime, procent_spor_vechime, spor_vechime);
commit;
end;
but when compiling i got PLS-00222. What i'm, doing wrong? ani_vechime and procent_spor_vechime are functions.
i checked and the functions are correct spelled and they exists
Please help me..
Thanks!
|
|
|
Re: PLS-00222 error [message #407724 is a reply to message #407722] |
Thu, 11 June 2009 05:31   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
You have local variables called ani_vechime and procent_spor_vechime.
Oracle is most likely getting confused abuot whether you're trying to reference a local variable or call a function.
Give your local variables meaningful names that also don't exist as objects in the database and try again.
|
|
|
|
|
Re: PLS-00222 error [message #408086 is a reply to message #408083] |
Sat, 13 June 2009 13:28  |
 |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Frank wrote on Sat, 13 June 2009 20:11 | Kevin Meade wrote on Sat, 13 June 2009 17:17 | this is one of my pet peves
|
+1
|
+1
|
|
|