Home » SQL & PL/SQL » SQL & PL/SQL » PLS-00222 error (Oracle 10gR2, Windows XP)
PLS-00222 error [message #407722] Thu, 11 June 2009 05:12 Go to next message
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 Go to previous messageGo to next message
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 #408071 is a reply to message #407724] Sat, 13 June 2009 10:17 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
this is one of my pet peves

pls-00222

what is this? Nice of you to post the error message for us. Do you really expect us to look it up in order to help you?

When you post information asking for help, don't use short cuts.

Kevin
Re: PLS-00222 error [message #408083 is a reply to message #408071] Sat, 13 June 2009 13:11 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Kevin Meade wrote on Sat, 13 June 2009 17:17
this is one of my pet peves

+1
Re: PLS-00222 error [message #408086 is a reply to message #408083] Sat, 13 June 2009 13:28 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
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
Previous Topic: Query to select a column value fro which other column is highest.
Next Topic: sql script
Goto Forum:
  


Current Time: Thu Dec 08 08:16:43 CST 2016

Total time taken to generate the page: 0.11142 seconds