Обсуждение: pgsql procedures??

Поиск
Список
Период
Сортировка

pgsql procedures??

От
Maurício Paiva
Дата:
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.

Re: pgsql procedures??

От
Bruno Wolff III
Дата:
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.


Re: pgsql procedures??

От
"Nigel J. Andrews"
Дата:
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



Re: pgsql procedures??

От
Tom Lane
Дата:
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