Generate output variables dynamically

I try to do following ang who get the mistake. Actually, I get all the column names and also create select statements dynamically at runtime. I do not have to hard code values ​​/ names.
This execution outputs everything as a single text. I will use that.ask