pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Ansley <Michael.Ansley@intec-telecom-systems.com>
Cc: 'rob' <rob@dsvr.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: plpgsql grief
Date: Mon, 12 Feb 2001 11:46:25 -0500
Message-ID: <18843.981996385@sss.pgh.pa.us> (raw)
In-Reply-To: <7F124BC48D56D411812500D0B747251480F3FC@FILESERVER002>
References: <7F124BC48D56D411812500D0B747251480F3FC@FILESERVER002>

Michael Ansley <Michael.Ansley@intec-telecom-systems.com> writes:
> create function testfunc (text) returns int4 as '
> declare
>   sql varchar;
> begin
>   sql=''SELECT id AS res2 FROM ''||$1 ;
>   execute sql ;
>   return res2;
> end;
> ' language 'plpgsql' ;

> Please note the AS syntax rather than INTO.

That won't work :-(

			regards, tom lane



view thread (14+ messages)  latest in thread

Message-ID: <18843.981996385@sss.pgh.pa.us>
Permalink:  ../18843.981996385@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18843.981996385@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Michael.Ansley@intec-telecom-systems.com, rob@dsvr.net
  Subject: Re: plpgsql grief
  In-Reply-To: <18843.981996385@sss.pgh.pa.us>
  References: <7F124BC48D56D411812500D0B747251480F3FC@FILESERVER002> <18843.981996385@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox