I have a specific used case where a row values needs to be converted into view column headers dynamically. The reason why this needs a view is because the column names depends on the row value of the input table that can change anytime.
Input: Table
Item Class Attribute Attribute_Val
------ ------- ---------- -------------
Apple Fruit Name Gala
Apple Fruit Color Red
Apple Fruit Origin USA
Apple Fruit Price 3
Mango Fruit Name Alphonso
Mango Fruit Color Yellow
Mango Fruit Origin MEX, IND
Mango Fruit Price 5
Expected Output: From a DB View
Item Class Name Color Origin Price
------ ------- ----- ------ ------ -----
Apple Fruit Gala Red USA 3
Mango Fruit Alphonso Yellow MEX,IND 5
Let's say tomorrow a new attribute(Season) is added for class "Fruit". It will result in 2 rows in the input table(one each for Apple and Mango items) and the view should be able to dynamically add a new column "Season" to its output.
Is this something that can be done thru an Oracle View or Function?