Re: select into - Mailing list pgsql-sql

From Andreas Kretschmer
Subject Re: select into
Date
Msg-id 20061124145519.GA5805@KanotixBox
Whole thread Raw
In response to Re: select into  (Adrian Klaver <aklaver@comcast.net>)
Responses Re: select into
List pgsql-sql
Adrian Klaver <aklaver@comcast.net> schrieb:

> On Thursday 23 November 2006 08:45 pm, Tom Lane wrote:
> > Mulham freshcode <mulhamcode@yahoo.com> writes:
> > > execute sql_str1 into svc_data_rec ;
> > >
> > > svc_data_rec is a RECORD, which is supposed to be dynamic.
> >
> > This should work --- in PG 8.1 or later.  In older versions you'd have
> > to fool around with a FOR ... IN EXECUTE ... loop.
> >
> >             regards, tom lane
> The documentation for pl/pgsql  in 8.1 and higher says different. 
> 
> http://www.postgresql.org/docs/8.1/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN
> " SELECT INTO is not currently supported within EXECUTE."

Thats right. The solution with 8.1 or later is:

EXECUTE .... INTO var, and _not_ SELECT INTO var.


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


pgsql-sql by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: select into
Next
From: Adrian Klaver
Date:
Subject: Re: select into