Re: Column names as variables in plpgsql - Mailing list pgsql-novice

From Derrick Betts
Subject Re: Column names as variables in plpgsql
Date
Msg-id 01ef01c69ec9$22f87080$0202a8c0@main
Whole thread Raw
In response to Re: insert more than one rows  ("Andrej Ricnik-Bay" <andrej.groups@gmail.com>)
List 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.kretschmer@schollglas.com>
To: <pgsql-novice@postgresql.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
>
>



pgsql-novice by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Column names as variables in plpgsql
Next
From: Fabrice Franquenk
Date:
Subject: WAL Internals question