Skip site navigation (1) Skip section navigation (2)

Re: Column names as variables in plpgsql

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Column names as variables in plpgsql
Date: 2006-07-03 05:00:04
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
am  30.06.2006, um 16:32:38 -0600 mailte Derrick Betts folgendes:
> Is it possible to assign a column name to a variable and then use that 
> variable in a SELECT statement inside a function using plpgsql?

Yes. You can define a string with your SQL, including variables. Thena
you can EXECUTE this string.

HTH, Andreas
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47215,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C
 ===    Schollglas Unternehmensgruppe    === 

In response to


pgsql-novice by date

Next:From: Derrick BettsDate: 2006-07-03 17:50:11
Subject: Re: Column names as variables in plpgsql
Previous:From: Guido BarosioDate: 2006-07-03 04:20:39
Subject: Re: Password Help?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group