Search
 
SCRIPT & CODE EXAMPLE
 

SQL

psql store procedure-return multiple table values

CREATE OR REPLACE FUNCTION get_production_deployment(appId integer)
  RETURNS TABLE(empId INTEGER, empName VARCHAR, designation VARCHAR) AS
$
BEGIN
 RETURN QUERY
 
 SELECT employee.id, employee.name, employee.designation
 FROM employee where employee.id = 
 (SELECT empId FROM prod_movement where prod_movement.appId = appId)

END; $
 
LANGUAGE plpgsql;
Comment

PREVIOUS NEXT
Code Example
::  
::  
::  
Javascript ::  
::  
::  
Javascript ::  
::  
Javascript ::  
::  
Javascript ::  
::  
::  
::  
::  
Javascript ::  
::  
::  
::  
::  
::  
::  
::  
::  
::  
::  
::  
Javascript ::  
::  
Javascript ::  
ADD CONTENT
Topic
Content
Source link
Name
6+2 =