Re: TEMPORARY TABLE in a PL/pgSQL function - Mailing list pgsql-novice

From Oliver Elphick
Subject Re: TEMPORARY TABLE in a PL/pgSQL function
Date
Msg-id 1134587919.4974.17.camel@linda.lfix.co.uk
Whole thread Raw
In response to Re: TEMPORARY TABLE in a PL/pgSQL function  ("Luiz K. Matsumura" <luiz@planit.com.br>)
Responses Re: TEMPORARY TABLE in a PL/pgSQL function
List pgsql-novice
On Wed, 2005-12-14 at 17:05 -0200, Luiz K. Matsumura wrote:
> Hi, I have a similar case
> but instead of the statement
> PERFORM * FROM temp_table;  -- without this line no problems
> I have a SELECT INTO inside the plpgsql function
> SELECT * INTO rec FROM temp_table;
> That return the same error as Tjibbe got.
> I try to use something like
> EXEC 'SELECT * INTO rec FROM temp_table';
> But I now postgres (8.1.1) returns a error
>
> EXEC of SELECT ... INTO is not implemented yet.

You have the syntax wrong.  It is:

   EXECUTE command-string [ INTO target ];

In your case, that is:

   EXECUTE 'SELECT * FROM temp_table' INTO rec;

so that the INTO phrase is outside the string.

--
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
   Do you want to know God?   http://www.lfix.co.uk/knowing_god.html


pgsql-novice by date:

Previous
From: "Luiz K. Matsumura"
Date:
Subject: Re: TEMPORARY TABLE in a PL/pgSQL function
Next
From: s anwar
Date:
Subject: Repercussions of killing a vacuum