0

How to display one or more tables in a single function in postgres as we do in sql server stored procedure?

Sql Server

Stored Procedure: UspGetValues

select StudentID,studentName from students:
Select TeacherID,TeacherName from Teacher

Postgres Sql: How we need to do?

James Z
  • 12,209
  • 10
  • 24
  • 44
user2432361
  • 133
  • 1
  • 3
  • 9
  • What do you mean by display one or more tables? Do you need to join these tables? Or maybe a UNION? You need to provide some more details before anybody understand the question. – Sean Lange Jul 26 '16 at 15:31
  • You are asking if there is a way to return multiple result sets from a function in PostgreSQL as you would do from a stored procedure in SQL Server? – Nick Jul 26 '16 at 17:37
  • @Nicarus Yes you are right – user2432361 Jul 26 '16 at 17:46
  • You can do that if the tables have the same columns, though I don't suspect yours do. Worth reading: http://stackoverflow.com/questions/756689/postgresql-function-returning-multiple-result-sets – Nick Jul 26 '16 at 17:48

0 Answers0