pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Kohnert <nospam001-lists@jan-kohnert.de>
To: pgsql-general@lists.postgresql.org
Subject: Postgres 11 procedures and result sets
Date: Mon, 01 Oct 2018 23:53:54 +0200
Message-ID: <10467048.Hd5HFnr8GS@kohni-mobil> (raw)

Hello List,

I have a question regarding the new stored procedures in Postgres 11 (I tested 
beta4):

I'd like to know if it is somehow possible to get a (or possibly more) result 
set from selects within the SP, as it is possible in MariaDB, MySQL, or SQL 
Server. 

What I found until now is to use inout-Parms. Then I have to define all 
columns in the select as inout-Params, but then I get only one line back, 
regardless how many lines >0 have been selected.

I could also define an inout refcursor param, and parse that one, but that 
would make the new SP identical to the well known functions returning a 
refcursor. And when I use that approach, I have an additional step in Qt-Code 
for example, since I have to exec the SP, then parse to the refcursor result, 
exec the fetch and then parse the cursor output I'm interested in.

Did I miss something? 

Thanks in advance!

-- 
MfG Jan






view thread (3+ messages)  latest in thread

Message-ID: <10467048.Hd5HFnr8GS@kohni-mobil>
Permalink:  ../10467048.Hd5HFnr8GS@kohni-mobil/
Also on:    postgresql.org/message-id/10467048.Hd5HFnr8GS@kohni-mobil

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: nospam001-lists@jan-kohnert.de
  Subject: Re: Postgres 11 procedures and result sets
  In-Reply-To: <10467048.Hd5HFnr8GS@kohni-mobil>
  References: <10467048.Hd5HFnr8GS@kohni-mobil>

* 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