pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paul Förster <paul.foerster@gmail.com>
To: Naveen Kumar <naveenmcp@gmail.com>
Cc: androxkentaki <androxkentaki@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: How to return multiple rows by stored procedure in postgresql
Date: Tue, 6 Oct 2020 08:40:20 +0200
Message-ID: <39B3366A-5C16-4477-9C5C-03D3689179CB@gmail.com> (raw)
In-Reply-To: <CAN+uLsEvZH1JdhDUfJaevz8AUyVgdX75ufnc0TgUZY9wquKaOg@mail.gmail.com>
References: <CAN+uLsG8ws_o8HtnZtvezte_74QQsT5qCs=1+fa+rY7ubv8HZw@mail.gmail.com>
	<CAL+gpC8FRukDicarW282TVd3_guZKW-Zbq8uw0xCObPovw+pcA@mail.gmail.com>
	<CAN+uLsEvZH1JdhDUfJaevz8AUyVgdX75ufnc0TgUZY9wquKaOg@mail.gmail.com>

Hi Naveen,

> On 06. Oct, 2020, at 08:15, Naveen Kumar <naveenmcp@gmail.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




view thread (7+ messages)  latest in thread

Message-ID: <39B3366A-5C16-4477-9C5C-03D3689179CB@gmail.com>
Permalink:  ../39B3366A-5C16-4477-9C5C-03D3689179CB@gmail.com/
Also on:    postgresql.org/message-id/39B3366A-5C16-4477-9C5C-03D3689179CB@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: paul.foerster@gmail.com, naveenmcp@gmail.com, androxkentaki@gmail.com
  Subject: Re: How to return multiple rows by stored procedure in postgresql
  In-Reply-To: <39B3366A-5C16-4477-9C5C-03D3689179CB@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox