Hi,
I have a dynamic pivot query I have created.
There are 3 fixed columns, and then 1..n pivot columns generated, usually 4 but anything up to 10.
I can build the dynamic sql fine, but I've just realised I can't set any static variables to use the sql in a cursor, as I don't know how many I need at design time, only run time.
I then thought I'd create a temporary global table to hold the results from the dynamic sql, and use a for loop instead to do my processing.
Again though I realised I can't do this as I don't know the table name at run time, and can't use dynamic sql in a for loop.
So basically that's as far as my ideas go and would like a suggestion as to how I can do this, or even whether I can.
I'm using ORACLE 11g
Thanks in advance