slt j'execute un appel de focntion et j'obtiens le message d'erreur suivant et je ne comprends pas pourquoi.
voici ma focntion
CREATE OR REPLACE FUNCTION "public"."update_term_attribute" (varchar ,varchar, varchar) RETURNS boolean AS
$body$
DECLARE
instance_rid ALIAS FOR $1; -- l_identifient du tuple
attribute_name ALIAS FOR $2; -- le nom de l'attribut
attribute_value ALIAS FOR $3; -- le nom de l_attribit dont on veut recuperer une valeur
sql_query VARCHAR; -- une chaine de caracteres qui contient une commande SQL
table_name VARCHAR;
valeur VARCHAR;
BEGIN
table_name:="TermOccurancy_e";
IF attribute_value ISNULL THEN
sql_query := 'UPDATE "TermOccurancy_e" SET ' || attribute_name || ' = null WHERE RID = ' || instance_rid || ' ;';
ELSE
sql_query := 'UPDATE "TermOccurancy_e" SET ' || attribute_name || ' = '''|| attribute_value || '''
WHERE RID = ' || instance_rid || ' ;';
END IF;
EXECUTE sql_query;
RETURN TRUE;
END;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
qd j'execute
SELECT update_term_attribute(15,'ref_termentry_rid',30);
j'obtiens
ERROR: function update_term_attribute(integer, "unknown", integer) does not exist at character 8
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
pourtant la column ref_termentry_rid existe bien dans la table termoccurancy_e
merci
Partager