What we are trying to figure out is if postgresql supports 
 returning multiple result sets from a stored procedure (psql 
 function?)
 
 For example in MSSQL's Northwind database you can create the 
 following stored procedure:
 
 <mssql-proc>
 CREATE PROCEDURE "test"
 AS
 SELECT * FROM Orders
 SELECT * FROM Customers
 GO
 </mssql-proc>
 
 This would return two datasets from the procedure.
 We are unsure as to how to map this in to a pgsql equivalent.







What we are trying to figure out is if postgresql 
supports  returning multiple result sets from a stored 
procedure (psql  function?)  For 
example in MSSQL's Northwind database you can create the  
following stored procedure:  
<mssql-proc> CREATE PROCEDURE 
"test" AS SELECT * FROM 
Orders SELECT * FROM 
Customers GO </mssql-proc>  
This would return two datasets from the procedure. We are unsure 
as to how to map this in to a pgsql 
equivalent.
Wed, 24 Sep 2003 20:21:20 -0300
=?iso-8859-1?Q?Maur=EDcio_Paiva?= <mauricio@acesso-online.com.br>
pgsql procedures??
On Wed, Sep 24, 2003 at 20:21:20 -0300,
  Maurï¿½cio Paiva <mauricio@acesso-online.com.br> wrote:
> What we are trying to figure out is if postgresql supports 
>  returning multiple result sets from a stored procedure (psql 
>  function?)

No, Postgres can't do that.

Thu, 25 Sep 2003 12:48:56 -0500
Bruno Wolff III <bruno@wolff.to>
Re: pgsql procedures??
On Thu, 25 Sep 2003, Bruno Wolff III wrote:

> On Wed, Sep 24, 2003 at 20:21:20 -0300,
>   Maurício Paiva <mauricio@acesso-online.com.br> wrote:
> > What we are trying to figure out is if postgresql supports 
> >  returning multiple result sets from a stored procedure (psql 
> >  function?)
> 
> No, Postgres can't do that.

But it can if you switch to one of the other languages like plpgsql, which
isn't terribly complicated but does require the language to be installed in the
database.

-- 
Nigel J. Andrews


Thu, 25 Sep 2003 20:29:54 +0100 (BST)
"Nigel J. Andrews" <nandrews@investsystems.co.uk>
Re: pgsql procedures??
Bruno Wolff III <bruno@wolff.to> writes:
> On Wed, Sep 24, 2003 at 20:21:20 -0300,
>   Maur�cio Paiva <mauricio@acesso-online.com.br> wrote:
>> What we are trying to figure out is if postgresql supports 
>> returning multiple result sets from a stored procedure (psql 
>> function?)

> No, Postgres can't do that.

You might be able to fake it by returning multiple cursors, however.

			regards, tom lane

Thu, 25 Sep 2003 15:52:11 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: pgsql procedures?? 