Search Postgresql Archives

Re: PL/pgSQL stored procedure returning multiple result sets (SELECTs)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




CREATE PROCEDURE list_user_accounts(IN user_id INT)

	BEGIN

	-- Return first result set (single row)
	SELECT * FROM users WHERE id = user_id;

	-- Return second result set (zero or more rows)
	SELECT * FROM accounts WHERE account_holder = user_id;

	END;


So, is it true that as of Postgresql 8.3 there is no way to have a
pgpqsql function return multiple SELECTs?


Vladimir Dzhuvinov

Have you considered returning XML instead? You should be able to get what your looking for much easier with an XMLAGG.

Artacus

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux