Hi Martin, >How do I use the columns defined in iDataList, in a PostgreSQL statement, to "select"? I build my select statement in a loop, the same way I add the user-selected columns to the row variable, so it selects the same subset of columns. Then I add the Where clause if any, and do a stmt.$execdirect() followed by a $fetch into iDataList. Kelly