Fwd: concatenate and use as field

From: Alain Roger <raf(dot)news(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Fwd: concatenate and use as field
Date: 2009-03-29 11:41:44
Message-ID: 75645bbb0903290441w5f12d718naafb206c9bb8f0b5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> Hi,
>
> i have a character varying variable and i concatenate with some other
> variable, using the '||' operator.
> the result of this concatenation should be the name of a column in my
> table.
>
> however i don't know how to tell that this new concatenated string is a
> column name.
> how to do it ?
> thanks.
>

in fact i'm trying to do the following thing:

select id, theme_ || $1 from themes;

and based on the parameter my stored procedure has received, it should
create something like that:
select id, theme_eng from themes;

if $1 = 'eng'

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alain Roger 2009-03-29 11:58:30 Fwd: concatenate and use as field
Previous Message Eugenio Modesti 2009-03-29 10:26:54 Re: problem with locale :