Return cols and rows via stored procedure

Поиск
Список
Период
Сортировка
От Robert James
Тема Return cols and rows via stored procedure
Дата
Msg-id CAGYyBggtqT8jhgOz5pcaBcrRMYLKYTT5dqJBg-2k+6ri2opsuQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Return cols and rows via stored procedure  (David Johnston <polobo@yahoo.com>)
Список pgsql-general
I'd like a stored procedure which does something like:

INSERT INTO...
SELECT... -- This should be returned as multicolumn, multifield - just
like a table or view

When I run it, though, instead of getting a table, I get one field
with all the data in it as a compound type.  I'd like to return the
results just like a view.

How do I do that?

Additionally, I'd like to put a:
DELETE...
at the end, but still return the SELECT (i.e. what SELECT said before
the DELETE).  Is that possible?

Finally, my preference is to do all this in a SQL stored procedure,
not PL/pgSQL or PL/anythingelse.

Thanks!


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

Предыдущее
От: BladeOfLight16
Дата:
Сообщение: Re: Update big table
Следующее
От: David Johnston
Дата:
Сообщение: Re: Return cols and rows via stored procedure