Hackers,

Is there a way to create a table from a prepared statement?  CREATE TABLE AS
explicitly says you have to use a SELECT statement, and the SELECT INTO
syntax doesn't seem to allow the use of a prepared statement either.  I
don't see a way to use the prepared statement as a function nor as a "table"
(SELECT ... FROM EXECUTE)

Of course, the prepared statement is a SELECT statement.

Am I missing something, or it is supposed to be like this?  I don't _need_
this (I can use a regular SQL function), but...

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"�Qu� importan los a�os?  Lo que realmente importa es comprobar que
a fin de cuentas la mejor edad de la vida es estar vivo"  (Mafalda)

Fri, 27 Jun 2003 12:15:10 -0400
Alvaro Herrera Munoz <alvherre@dcc.uchile.cl>
CREATE TABLE AS ... EXECUTE
Alvaro Herrera Munoz <alvherre@dcc.uchile.cl> writes:
> Is there a way to create a table from a prepared statement?  CREATE TABLE AS
> explicitly says you have to use a SELECT statement, and the SELECT INTO
> syntax doesn't seem to allow the use of a prepared statement either.

IIRC there is an EXECUTE INTO.

			regards, tom lane

Fri, 27 Jun 2003 12:36:54 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: CREATE TABLE AS ... EXECUTE 
Alvaro Herrera Munoz writes:

> Is there a way to create a table from a prepared statement?  CREATE TABLE AS
> explicitly says you have to use a SELECT statement, and the SELECT INTO
> syntax doesn't seem to allow the use of a prepared statement either.  I
> don't see a way to use the prepared statement as a function nor as a "table"
> (SELECT ... FROM EXECUTE)

There's EXECUTE INTO, but when I find time I will change it to CREATE
TABLE AS ... EXECUTE, because we don't really like SELECT INTO, so EXECUTE
INTO doesn't seem the right solution.

-- 
Peter Eisentraut   peter_e@gmx.net


Fri, 27 Jun 2003 21:57:18 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: CREATE TABLE AS ... EXECUTE