Re: EXECUTE with SELECT INTO variable, or alternatives

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Thomas F(dot) O'Connell" <tfo(at)sitening(dot)com>
Cc: mario(dot)splivalo(at)mobart(dot)hr, pgsql-sql(at)postgresql(dot)org
Subject: Re: EXECUTE with SELECT INTO variable, or alternatives
Date: 2005-09-30 23:34:17
Message-ID: 20050930233417.GA44295@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Sep 30, 2005 at 03:59:06PM -0500, Thomas F. O'Connell wrote:
> Per the docs:
>
> "The results from SELECT commands are discarded by EXECUTE, and
> SELECT INTO is not currently supported within EXECUTE. So there is no
> way to extract a result from a dynamically-created SELECT using the
> plain EXECUTE command. There are two other ways to do it, however:
> one is to use the FOR-IN-EXECUTE loop form described in Section
> 35.7.4, and the other is to use a cursor with OPEN-FOR-EXECUTE, as
> described in Section 35.8.2."

8.1 will have EXECUTE ... INTO.

http://developer.postgresql.org/docs/postgres/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

--
Michael Fuhr

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message brett 2005-10-01 22:32:05 BirthDay SQL Issue
Previous Message solarsail 2005-09-30 22:47:48 query tables based on a query