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
Sql :: oracle logfile switch 
Sql :: compound trigger oracle 
Sql :: mysql group rows with same value 
Sql :: concatenation in sql 
Sql :: sql asc 
Sql :: drop tables from local database postgres pgadmin 
Sql :: mysql max connections exceeded max_connections_per_hour 
Sql :: difference between left outer join and left join in sql 
Sql :: automate mysql cli query 
Sql :: sql quary intervewi question 
Sql :: how to increase the width of the screen in oracle 
Sql :: grab part of a string sql 
Sql :: mysql undo delete 
Sql :: sql full outer join 
Sql :: sql is null and is not null 
Sql :: oracle sql count occurrences of value in column 
Sql :: advantages of stored procedures sql 
Sql :: inspecting a column unique/distinct values in SQL 
Sql :: postgres drop type 
Sql :: install mssql on ubuntu 
Sql :: mysql curdate between two dates 
Sql :: aggregate functions 
Sql :: TSQL convert csv to table 
Sql :: sql like operator 
Sql :: how to define a non primary composite key in sql 
Sql :: sql Not like operator 
Sql :: sql select condition with left join 
Sql :: use mysql in java program 
Sql :: mysql and or 
Sql :: PDOException: SQLSTATE[HY093]: Invalid parameter numb 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =