Search Postgresql Archives

Re: Variable column name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In response to "Bob Pawley" <rjpawley@xxxxxxx>:
> 
> 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.

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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux