Re: Column names as variables in plpgsql

From: "Derrick Betts" <derrick(at)blueaxis(dot)com>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Column names as variables in plpgsql
Date: 2006-07-03 17:50:11
Message-ID: 01ef01c69ec9$22f87080$0202a8c0@main
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Excellent! Thank you so much! I've been searching for this solution for a
very long time. Your response is very much appreciated.

Derrick
----- Original Message -----
From: "A. Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Sent: Sunday, July 02, 2006 11:00 PM
Subject: Re: [NOVICE] Column names as variables in plpgsql

> 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.
>
> http://www.postgresql.org/docs/8.1/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN
>
>
> HTH, Andreas
> --
> Andreas Kretschmer (Kontakt: siehe Header)
> Heynitz: 035242/47215, D1: 0160/7141639
> GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
> === Schollglas Unternehmensgruppe ===
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Fabrice Franquenk 2006-07-04 15:44:41 WAL Internals question
Previous Message A. Kretschmer 2006-07-03 05:00:04 Re: Column names as variables in plpgsql