1CREATE OR REPLACE FUNCTION get_production_deployment(appId integer)
2 RETURNS TABLE(empId INTEGER, empName VARCHAR, designation VARCHAR) AS
3$
4BEGIN
5 RETURN QUERY
6
7 SELECT employee.id, employee.name, employee.designation
8 FROM employee where employee.id =
9 (SELECT empId FROM prod_movement where prod_movement.appId = appId)
10
11END; $
12
13LANGUAGE plpgsql;