plpgsql Result Sets

Поиск
Список
Период
Сортировка
От Brandon E Hofmann
Тема plpgsql Result Sets
Дата
Msg-id OFF1AA4319.71C348B2-ON8625718C.0062B2D9-8625718C.0062E814@notes.ntrs.com
обсуждение исходный текст
Ответы Re: plpgsql Result Sets  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-general
When using a temp table in plpgsql functions that has columns comprised
from many tables populated by joins, how do you specify a temp table return
type when its generated by select into and dropped dynamically?  I get an
error when I specify returns setof temp_table.  Also when I specify a
permanent table as the return type, I get extra blank columns in the result
set which are the additional columns of the permanent table I don't need
and the data is displayed in the wrong columns.

I tried defining composite types, but get a runtime error that it isn't
available unless I first define it outside of the function.  Since requests
are dynamic, its impossible for me to determine all possible composite
types required ahead of time.

In plpgsql, how do you return back a result set that is determined and
generated at runtime based on a report request?  Also why does plpgsql
require you to define what is returned?

I'm relatively new to PostgreSQL and really impressed by its capabilities.
Do you have any examples showing how to define and return a dynamic result
set at runtime within a function?

Any help would be greatly appreciated.

Thanks,

Brandon


В списке pgsql-general по дате отправления:

Предыдущее
От: brian ally
Дата:
Сообщение: Re: Fabian Pascal and RDBMS deficiencies in fully
Следующее
От: "Carlos H. Reimer"
Дата:
Сообщение: RES: XID comparations