Janek Sendrowski <janek12@web.de> wrote:
> I just can't understabd why it's not possible to store multiple
> columns returning from a dynamic Select statement which is
> executet with EXECUTE into a temporary table.
You can:
CREATE TEMPORARY TABLE AS SELECT ...
http://www.postgresql.org/docs/current/interactive/sql-createtableas. html
As the Notes section says:
| This command is functionally similar to SELECT INTO, but it is
| preferred since it is less likely to be confused with other uses
| of the SELECT INTO syntax. Furthermore, CREATE TABLE AS offers a
| superset of the functionality offered by SELECT INTO.
Also see this:
http://www.postgresql.org/docs/current/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-ASSIGNMENT
| Tip: Note that this interpretation of SELECT with INTO is quite
| different from PostgreSQL's regular SELECT INTO command, wherein
| the INTO target is a newly created table. If you want to create a
| table from a SELECT result inside a PL/pgSQL function, use the
| syntax CREATE TABLE ... AS SELECT.
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company