0
I am a beginner in postgresql and I have a question that I cannot solve. I made a simple function in the database that updates a record:
CREATE OR REPLACE FUNCTION public.teste(
p_rec_id_transacao character varying,
p_rec_valorA numeric)
RETURNS boolean AS
$BODY$
BEGIN
UPDATE financeiro_recebimentos SET rec_valorA=p_rec_valorA
WHERE rec_id_transacao = P_rec_id_transacao;
IF FOUND THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END
$BODY$
LANGUAGE plpgsql
Everything works right, but when I add a new parameter and put in UPDATE returns an error when I call the function, the table is set correctly and worse, when I run with the debug of Pgadmin3 works:
CREATE OR REPLACE FUNCTION public.teste(
p_rec_id_transacao character varying,
p_rec_valorA numeric,
p_rec_valorB numeric)
RETURNS boolean AS
$BODY$
BEGIN
UPDATE financeiro_recebimentos SET rec_valorA=p_rec_valorA,
rec_valorB=p_rec_valorB
WHERE rec_id_transacao = P_rec_id_transacao;
IF FOUND THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END
$BODY$
LANGUAGE plpgsql
When I call the function "SELECT test('DJUNU',1.0,2.0)" returns the error:
HINT: No Function Matches the Given name and argument types. You Might need to add Explicit type Casts.
Whoever has the patience to answer, thank you.
correcting:UPDATE financial_receipts SET rec_valorA=p_rec_valorA, rec_valorB=p_rec_valorB
– LMeira
you can correct any detail of the question by using the edit option: https://answall.com/posts/220655/edit
– Rovann Linhalis