Bonjour, monsieur j'ai erreur au niveau de PACKAGE BODY ,dans definition de procedure,j'arrive pas a trouver l'erreur. Voila le script:
CREATE OR REPLACE PACKAGE Pkg_mont IS
FUNCTION Montant(C IN Formation.CodForm%TYPE) RETURN number;
FUNCTION Reste( CodPart IN Participant.CodPart%TYPE) RETURN number;
PROCEDURE FuturFormation(X IN Formation.DatDebut%TYPE);
end;
/
CREATE OR REPLACE PACKAGE BODY Pkg_mont IS
FUNCTION Montant(C IN Formation.CodForm%TYPE) RETURN number IS m number ;
begin
select SUM(Avance) INTO m from Inscription where CodForm=C;return(m);
Exception
When NO_DATA_FOUND then
return(-1);
end ;
FUNCTION Reste( C IN Participant.CodPart%TYPE) RETURN NUMBER IS r NUMBER ;
CURSOR Mont_form IS
select F.CodForm,Prix,Avance from Formation F,Participant P,Inscription I where F.CodForm=I.CodForm and I.CodPart=P.CodPart ;
x number;
begin
for e IN Mont_form loop
select COUNT( DISTINCT e.CodForm)*Prix INTO X from Formation F,Participant P,Inscription I where F.CodForm=I.CodForm and I.CodPart=P.CodPart and P.CodPart=C;
r:=X-e.Avance;
if (r>0) then
return(r);
else
return(0);
end if;
end loop;
end Reste;
PROCEDURE FuturFormation(X IN Formation.DatDebut%TYPE) IS
begin
X:=date();
select F.CodForm from Formation F where Datediff(year,X,DatDebut)>0 and Datediff(year,X,DatDebut)>0 and Datediff(year,X,DatDebut)>0 ;
dbms_output.put_line( ||F.CodForm||);
end ;
end ;
/