Hi, i was trying to create a function that ask the user for an employe code then take that code and search in my EMPLOYE table andreturn all informations about the employe.
I did this but, it gives me an error , could someone help me to figure this out please .
CREATE OR REPLACE FUNCTION fNombreProjets(code_Emp IN NUMBER)
RETURN number IS
ALLO number(100) := 0;
BEGIN
SELECT e.IDEMPLOYE ,
e.NOMEMPLOYE ,
e.ADRESSE ,
e.TELEPHONE ,
e.ADRESSECOURRIEL
FROM Employe e
WHERE idEmploye= code_Emp;
DBMS_OUTPUT.PUT_LINE('Code employe : ' || e.code_Emp ||chr(13)||chr(10) ||
'Nom employe : ' || e.nomEmploye ||chr(13)||chr(10)||
'Adresse employe : ' || e.adresse ||chr(13)||chr(10)||
'Telephone employe : ' || e.telephone ||chr(13)||chr(10)||
'Adresse Courriel employe : ' || e.adresseCourriel ||chr(13)||chr(10));
RETURN ALLO;
END;
ACCEPT val NUMBER PROMPT 'Entrer le code Employé: '
DECLARE
code_Emp NUMBER := '&val';
myname varchar2(200);
BEGIN
code_Emp := fNombreProjets(code_Emp);
END;
THANK YOU ALL !