That's just an unpivot:
select * from t
unpivot (
val for col in ( col1, col2 )
);
If more columns are there then print the row values into table using collections for better performance.I'm not sure what you're getting at here. Why do you want to use collections and why do you think they'll improve performance?