dynamically Creating output Structures at runtime

dynamically Creating output Structures at runtime

  
Hi All,
I am facing an issue while running dynamically generated SQL...my Columns are dynamically generated so i will not be able to define the output sturcture at the complie time.So how can i over come this issue?
can the output Struvture be defined at runtime?

Hi Nithin,

Unfortunately, you can't. Apart from the maintainability issue with such SQL, you'll have to define a superset of columns, and have a structure for that. The dynamically generated SQL must then add fixed values in unused columns.
Hi Nithin,

I think it's not possible. The output structure must match the columns of the advanced sql. How are you dynamically generating these columns? A workaround would be to create some queries, each one with an output, and put a switch condition that execute one of them... idk how your are implementing your logic, it's only an idea, ok? 

[EDIT] The Kilian's idea works fine too, can be a better approach ;)

Hope it helps.

Cheers