From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | Ray Madigan <ray(at)madigans(dot)org> |
Cc: | Pgsql-Sql <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Computed table name in function |
Date: | 2007-10-10 18:52:04 |
Message-ID: | 470D1F54.6090200@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Ray Madigan wrote:
> I thought that the documentation said I couldn't use EXECUTE on a SELECT
> INTO?
"37.6.5. Executing Dynamic Commands
Oftentimes you will want to generate dynamic commands inside your
PL/pgSQL functions, that is, commands that will involve different tables
or different data types each time they are executed. PL/pgSQL's normal
attempts to cache plans for commands will not work in such scenarios. To
handle this sort of problem, the EXECUTE statement is provided:
EXECUTE command-string [ INTO [STRICT] target ];
where command-string is an expression yielding a string (of type text)
containing the command to be executed and target is a record variable,
row variable, or a comma-separated list of simple variables and
record/row fields.
"
There's also a FOR..IN EXECUTE loop too
--
Richard Huxton
Archonet Ltd
From | Date | Subject | |
---|---|---|---|
Next Message | Mike Adams | 2007-10-10 23:25:53 | Refactored queries needing validation of syntactic equivalence |
Previous Message | Daniel Drotos | 2007-10-10 18:50:04 | Re: Computed table name in function |