From: Michael Burke <michael@engtech.ca>
To: pgsql-sql@postgresql.org
Subject: Sub-query as function argument
Date: Tue, 20 Dec 2005 09:42:51 -0400
Message-ID: <200512200942.51624.michael@engtech.ca> (raw)
Is it possible to execute a SELECT query as an argument to a function?
Example:
SELECT my_func('Sample', NULL, SELECT MIN(year) FROM audio);
In my particular case, my_func inserts columns into another table; I wish to
use values from another table as the arguments. The interior SELECT will
return only a single value; perhaps it needs to be wrapped in another
function?
TIA.
Mike.
--
Michael Burke
michael@engtech.ca
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: michael@engtech.ca
Subject: Re: Sub-query as function argument
In-Reply-To: <200512200942.51624.michael@engtech.ca>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox