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: 20060703050003.GA4905@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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.

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 ===

In response to

Responses

Browse pgsql-novice by date

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