Re: Variable column name

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Re: Variable column name
Дата
Msg-id 20110901105935.da14dcf6.wmoran@potentialtech.com
обсуждение исходный текст
Ответ на Variable column name  ("Bob Pawley" <rjpawley@shaw.ca>)
Ответы Re: Variable column name
Список pgsql-general
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
columnwith 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.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

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

Предыдущее
От: "Bob Pawley"
Дата:
Сообщение: Variable column name
Следующее
От: "Bob Pawley"
Дата:
Сообщение: Re: Variable column name