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!