CREATE OR REPLACE FUNCTION nomEtudiant(numEtud integer) RETURNS void AS $$
DECLARE
nom VARCHAR;
BEGIN
SELECT etud_nom INTO nom FROM etudiant WHERE etud_num=numEtud;
END; $$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION nomPrenomEtudiant(numEtud integer) RETURNS void AS $$
DECLARE
nom VARCHAR;
prenom VARCHAR;
BEGIN
SELECT etud_nom, etud_prenom INTO nom, prenom FROM etudiant WHERE etud_num=numEtud;
END; $$ LANGUAGE plpgsql;
=>SELECT nomEtudiant(1); nomEtudiant --------------------------- (1 row)
=>SELECT nomPrenomEtudiant(1); nomprenometudiant ------------------- (1 row)