psql store procedure return multiple table values

Solutions on MaxInterview for psql store procedure return multiple table values by the best coders in the world

showing results for - "psql store procedure return multiple table values"
Maximilien
01 Jul 2020
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;
similar questions