Re: Can you combine text variable together to referenece a VIEW name ? - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Can you combine text variable together to referenece a VIEW name ?
Date
Msg-id 461A8C59.6060606@iol.ie
Whole thread Raw
In response to Can you combine text variable together to referenece a VIEW name ?  ("Bigjim" <bigjim.still@rogers.com>)
Responses Re: Can you combine text variable together to referenece a VIEW name ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 09/04/2007 00:36, Bigjim wrote:

> I am trying to combine 2 text variable togther to form the name of a
> VIEW.  example
 >
>    SELECT * FROM ( 'april'||'may') ;

I think you want to use EXECUTE from within a pl/pgsql function to
construct and execute a query dynamically - have a look at this:

http://www.postgresql.org/docs/8.2/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

HTH,

Ray.


---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------

pgsql-general by date:

Previous
From: "filippo"
Date:
Subject: Re: perl DBI: problems searching text strings with ' symbol (es d'ambrose)
Next
From: Alvaro Herrera
Date:
Subject: Re: Problem with copying data