Re: Variable column name

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Variable column name
Дата
Msg-id 201109010816.24049.adrian.klaver@gmail.com
обсуждение исходный текст
Ответ на Re: Variable column name  ("Bob Pawley" <rjpawley@shaw.ca>)
Список pgsql-general
On Thursday, September 01, 2011 8:04:49 am Bob Pawley wrote:
> -----Original Message-----
> From: Bill Moran
> Sent: Thursday, September 01, 2011 7:59 AM
> To: Bob Pawley
> Cc: Postgresql
> Subject: Re: [GENERAL] Variable column name
>
> In response to "Bob Pawley" <rjpawley@shaw.ca>:
> > I want to add information to multiple columns (20 – 40) by employing a
> > loop. Each pass of the loop will populate one column with an array.
> >
> > I have tried and I have read that variables can not be used to control
> > column names.
> >
> > Is there a means of working around this restriction other than creating
> > 20 to 40 hard coded statements??
>
> You can generate dynamic SQL statements with plpgsql.
>
> Would it be possible for you to point me to an example??


http://www.postgresql.org/docs/9.0/interactive/plpgsql-statements.html#PLPGSQL-
STATEMENTS-EXECUTING-DYN
--
Adrian Klaver
adrian.klaver@gmail.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: Variable column name
Следующее
От: Bill Moran
Дата:
Сообщение: Re: Variable column name