Am Dienstag, 25. Juli 2006 17:56 schrieben Sie:
> You could use a procedural language like plpgsql.
Ok, using the plpgsql approach I tried this:
CREATE FUNCTION my_function(int4) RETURNS SETOF int8 AS
$BODY$
DECLARE
myrow RECORD;
BEGIN
IF (some_condition) THEN
FOR myrow IN SEL
On Tue, 25 Jul 2006, Christian Schoenebeck wrote:
> Am Dienstag, 25. Juli 2006 00:01 schrieb Stephan Szabo:
> > The above basically looks like:
> > CASE WHEN THEN ELSE
> > END.
> >
> > In SQL92 at least, the form of which looks like (SELECT
> > ...) is which is limited to 1 column and 1 row.
Am Dienstag, 25. Juli 2006 00:01 schrieb Stephan Szabo:
> The above basically looks like:
> CASE WHEN THEN ELSE
> END.
>
> In SQL92 at least, the form of which looks like (SELECT
> ...) is which is limited to 1 column and 1 row. The
> other subquery forms don't look legal in that position unl
On Mon, 24 Jul 2006, Christian Schoenebeck wrote:
> Consider the following server side function:
>
> CREATE FUNCTION my_function(int4) RETURNS SETOF int8 AS
> $BODY$
> SELECT
> CASE WHEN (some_condition)
> THEN (
> SELECT ... -- arbitrary select (returning row(s) of int8 values)
>