Bonjour,
voici ma procédure :
DROP FUNCTION return_quantite_produit(integer);
CREATE FUNCTION return_quantite_produit(integer) RETURN integer AS'
DECLARE
noprod as ALIAS FOR $1;
quantite_prod integer;
BEGIN
SELECT INTO quantite_prod FROM produit WHERE id_prod = noprod;
IF (quantite_prod ISNULL) THEN
quantite_prod:=0;
END IF;
RETURN quantite_prod;
END;
'
LANGUAGE 'plpgsql';
voic l'erreur que ca me fé à la création :
ERROR: parser: parse error at or near "RETURN" at character 50
Voyez vous l'erreur ?
Si oui merci de me la faire connaitre svp.
Autre chose, vu qu'a la premiere creation la fonction return_quantite_produit n'existe pas, en faisant un DROP function y me lance une erreur aussi, ya t'il un moyen d'y remedier ? Ah oui avec un CREATE OR REPLACE (G répondu tt seul a ma question !) lol
Jérémy
Partager