i am trying to return a query result inside a postgres function. I tried this and worked perfectly:
CREATE OR REPLACE FUNCTION getIncomingAreaMovements(v1 integer)
RETURNS integer AS $$
DECLARE
BEGIN
return id_part_movement From part_movement where id_area_final_destination = $1;
END;
$$ LANGUAGE plpgsql;
The things is that I need something to return the result of:
Select * From part_movement where id_area_final_destination = $1;
what return do I need or what should I change to achieve this?