title: Dynamic select columns in Oracle Reports Builder
body: <p>I'm trying to create a report that has a dynamic "breakdown" (grouping) based on a user entered parameter. For the purpose of this question assume records belong to both a "group" and "sub-grouping" and that the user can choose to see the sum/counts of the entire group, or they can see it separated out with the sub-groupings that make up the group. In reality I have more then two groupings, and how they work are fairly different, so having a case statement that populates a "breakdown" field isn't the best option even though it might appear that way in the simplified explanation I gave.</p>
  
  <p>In the past we would create a global temp table and the report would build a dynamic SQL statement which it used to populate it. The GTT would then be read by the report as a simple query and the "breakdown" field we populated within it would allow everything to work as needed. What I would like to do however, is remove the need for a GTT altogether if possible.</p>
  
  <p>What I have tried so far was to replace the SQL Query in the report with a Ref Cursor Query, which I then setup with a simple ref cursor. I'm able to get results back from this as long as the query is entirely hard-coded in, but as soon as I use lexical parameters within it I get an error saying that "This feature is not supported in client-side programs". I have since learned that Oracle Reports Builder requires Strong ref cursors in order to know what fields to expect, and that by using lexical parameters in my query I was making my ref cursor Weak.</p>
  
  <p>I have defined a record type within my report which I was hoping I could somehow bind to the Ref Cursor Query so that it would know what fields to expect even if the query that fills them was Weak, but I'm not having any luck figuring that out.</p>
  
  <p>Is there a piece to this puzzle that I am missing or can anyone else see a better way to accomplish what I'm trying to do?</p>