Skip to Main Content

APEX

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!

ORA-01785: ORDER BY item must be the number of a SELECT-list expression

692062Jun 30 2009 — edited Jun 30 2009
Apex 3.1.1, Oracle 10g

Hello,
I've been getting this error message sporadically, and finally figured out how to replicate the error consistently. The problem occurs in a standard report using SQL Query (PL/SQL function body returning SQL query). I found several other posts mentioning the same problem like this: 3235601

My example on apex.oracle.com is here: [http://apex.oracle.com/pls/otn/f?p=23292:4:427533145943010:::::] with guest/example credentials. Run page 4. If you click on demo_customers and sort on credit_limit, then click on demo_users, you should get the error. If you click on debug, you'll see the following:
0.06: show report 
0.07: determine column headings
0.07: activate sort
0.07: parse query as: WFU_CARS
0.07: query could not be parsed:
select  * from DEMO_USERS
 order by 11,1
failed to parse SQL query:
ORA-01785: ORDER BY item must be the number of a SELECT-list expression
It appears that the ORDER BY clause is not resetting? refreshing? when the source of the report changes. Note that the sort on demo_customers on the credit_limit column was column 11. When the demo_users query is run, an ORDER BY 11,1 is appended to the SQL statement.

Any ideas how to fix this? Thanks!

Lisa
This post has been answered by 438381 on Jun 30 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2009
Added on Jun 30 2009
2 comments
3,420 views