Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting multiple columns to rows at run time?

2965634Jun 21 2017 — edited Jun 29 2017

Hi Guys,

I have a requirement where I need to convert the output of a query from columns to rows at run time.

SELECT 123 KI1, 456 KI2, 789 KI3, 214 KI4 FROM DUAL;

This query execution is happening in a procedure and we don't know how many columns will be returned. Columns names are also unknown to us during the exceution. Requirement is to get the below output. Please do let me know how should I approach to this.

KI_ID
KI_VALUE
KI1123
KI2456
KI3789
KI4214

Thanks,

Kamal

This post has been answered by John Thorton on Jun 21 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2017
Added on Jun 21 2017
5 comments
432 views