CREATE OR REPLACE FUNCTION data.first()
AS $BODY$
DECLARE
res numeric;
BEGIN
PERFORM data.second(5,3,4);
IF(res > 10)THEN
something
ELSEIF(res < 10)THEN
something else
END IF
END;
$BODY$;
=========================================
CREATE OR REPLACE FUNCTION data.second(
a numeric,
b numeric,
c numeric
OUT res numeric
)
RETURNS numeric
AS $BODY$
BEGIN
res = a + b;
END;
$BODY$;
How do I use res in the parent function?
PERFORMand theSELECT ... INTOoption, andFOUNDvariable, as discussed in the plpgsql manual.