Re: How to return multiple rows by stored procedure in postgresql

From: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
To: Naveen Kumar <naveenmcp(at)gmail(dot)com>
Cc: androxkentaki <androxkentaki(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How to return multiple rows by stored procedure in postgresql
Date: 2020-10-06 06:40:20
Message-ID: 39B3366A-5C16-4477-9C5C-03D3689179CB@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Naveen,

> On 06. Oct, 2020, at 08:15, Naveen Kumar <naveenmcp(at)gmail(dot)com> wrote:
>
> Thank you for the quick response.
>
> All the examples are talking about functions, not about procedures in PostgreSQL. what i am looking for is how to return multiple rows by calling STORED PROCEDURE in postgreSQL 12 version.
>
> Thank you
> Naveen

a procedure does by definition not return anything. If you want to return something, use a function.

As for returning multiple rows, use create function ... returns table (columns...)

https://www.postgresql.org/docs/current/sql-createfunction.html
https://www.postgresql.org/docs/current/sql-createprocedure.html

Cheers,
Paul

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Nagaraj Raj 2020-10-06 07:50:02 Re: How to add partitions to the existing table in PostgreSQL
Previous Message Naveen Kumar 2020-10-06 06:31:02 How to add partitions to the existing table in PostgreSQL