Re: returning a recordset from PLpg/SQL
От | Richard Huxton |
---|---|
Тема | Re: returning a recordset from PLpg/SQL |
Дата | |
Msg-id | 40C6D140.8010701@archonet.com обсуждение исходный текст |
Ответ на | returning a recordset from PLpg/SQL (Terence Kearns <terencek@isd.canberra.edu.au>) |
Список | pgsql-sql |
Terence Kearns wrote: > Looking at the datatypes you can RETURN, it doesn't seem that there is a > way to return a recordset > > I tried > RETURNS SETOF RECORD > but that doesn't work > > I even tried > RETURNS SETOF fooTable%ROWTYPE > > What I would like to do is not that simple, I need to be able to > build/declare a record definition with an arbitary list of columns and > then return a set of that record which has it's values populated by > queries and calculations inside the procedure. Declare your datatype (CREATE TYPE ...) and return a SETOF that. What you can't do is declare your datatype inside your function. Clearly PostgreSQL needs to know what type is being returned while parsing the function, so you can't have a "dynamic type" (if such an idea has any meaning at all). -- Richard Huxton Archonet Ltd
В списке pgsql-sql по дате отправления: