Re: PL/pgSQL - Mailing list pgsql-general

From Bruce Momjian
Subject Re: PL/pgSQL
Date
Msg-id 200210041515.g94FFsu03120@candle.pha.pa.us
Whole thread Raw
In response to PL/pgSQL  ("Wojciech Strza³ka" <wojtek_strzalka@interia.pl>)
List pgsql-general
Wojciech Strza?ka wrote:
> i've got a simple plsql function and this line is wrong:
>
>    EXECUTE ''SELECT INTO lp MAX('' || column || '') AS MX FROM '' || table
> || '';'';
>
> with error message:
>
> "parse error at or near 'INTO' "
>
> it seems like it don't recognize SELECT INTO - but what's wrong?

In PL/pgSQL, you have to use CREATE TABLE ... AS because INTO has
another meaning in PL/pgSQL.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: speed of server side languages
Next
From: "shey sewani"
Date:
Subject: DTOI4 integer out of range