Multiple "selects" returned from a single stored procedure - Mailing list pgsql-hackers

From Shachar Shemesh
Subject Multiple "selects" returned from a single stored procedure
Date
Msg-id 409947B0.7070609@shemesh.biz
Whole thread Raw
Responses Re: Multiple "selects" returned from a single stored procedure
List pgsql-hackers
Hi list,

I'm in the process of porting an existing MS-SQL database to PostgreSQL.
The application uses OLE DB (and that's why I'm writing the OLE DB for
Postgresql). One of the requirements is that we will introduce as little
changes to the application. It has to be able to work with both
databases, as well as Access (which is not really a database).

Now the question:
MS-SQL has the capacity for both out variables from stored procedures,
as well as running several "selects" inside the procedures, and then
giving the results for all selects to the caller. Fortunetly for me,
that specific application doesn't run more than one select per stored
procedure.

The way I handled out variables so far was to have the function return a
compound type, with the variables as rows. With embedded selects,
however, this will no longer work.

I guess what I would like to suggest is for the thus far unused "select"
command in PLPGSQL to be used, in some way, to return values outside the
scope of the strict "returns" context. I guess out variables will also
be nice, but that's besides the point.

If anyone has any ideas on how to both modify called parameters, and
return a rowset, please let me know. Best I came up with so far was to
create a temporary table for the out vars or the selects. I can then rig
the OLE DB to make it look as if the function returned that.
            Shachar

-- 
Shachar Shemesh
Lingnu Open Systems Consulting
http://www.lingnu.com/






pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ALTER TABLE TODO items
Next
From: Tom Lane
Date:
Subject: Re: initdb failure in CVS