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!

Getting Error : ORA-01467: sort key too long

991835Mar 5 2013 — edited Mar 8 2013
We are getting ORA-01467: sort key too long in one of the table TABLE_HEADER.
The above view is doing transpose of data for 400 columns and it was working fine till last week. Now getting error as ORA-01467: sort key too long.
I do not want to alter the query ,please provide a solution on how do I make the query work?

select
distinct
Table_Name,
Feed_ID,
first_value(case when Field_Display_Order = 1 then field_name end ignore nulls) over (partition by table_name ) as field_1 ,
first_value(case when Field_Display_Order = 2 then field_name end ignore nulls) over (partition by table_name ) as field_2 ,
.
.
.
.
.
.
.
.
--Upto
.
.
.
.
first_value(case when Field_Display_Order = 399 then field_name end ignore nulls) over (partition by table_name ) as field_399 ,
first_value(case when Field_Display_Order = 400 then field_name end ignore nulls) over (partition by table_name ) as field_400
from
TABLE_HEADER
where
table_name like 'STG%';
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2013
Added on Mar 5 2013
3 comments
520 views