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

cloakedAug 23 2007 — edited Oct 31 2008
I have a dynamic SQL on a page. The SQL is dynamic because there are 3 LOV fields from which the user may make selections, and those field values are used in the WHERE clause. Also, the 2nd LOV field is populated with AJAX based on the 1st LOV's selection. And, the SQL joins to another table. The report has 7 sortable columns. The main table the SQL runs over has about 1,000 rows in it.
The 2nd table has about 500 rows. (Sorry, I'm not sure what information you might need to help me, so I listed several details.)

The application, and page, have been working flawlessly for several weeks. Then, yesterday the page was being used and the user received the "ORA-01785: ORDER BY item must be the number of a SELECT-list expression" error. The error just appeared out of the blue, so to speak. After weeks of of usage this is the first time this error has appeared. The application had not been changed, but they had been entering data into the main table and the table joined to in the SQL. The application is in production, so I can't put the application into DEBUG, etc. to see what SQL is being built.

Anyway, I was trying to debug the page today and was doing selections and seeing what would display, then as suddenly as the page quit working it started working correctly. No code changes made, no server changes made (to my knowledge), and no data changes made.

I'm new to both Oracle and Apex, and am not a SQL, Oracle or Apex expert. So, I am very perplexed and don't have any idea of what could be happening.

I don't know if it's an issue with the SQL, AJAX not loading the select fields properly, a corrupted table, a server load issue, or something else all together.

Any suggestions?

Also, I'm not familiar with Oracle error messages. Can they be red herrings sometimes? Because, I don't programmaticly code the ORDER BY of the SQL. Apex appends that part. So, how could that aspect quit working. And, then suddenly start working.

Sorry, but I'm extremely confused. :-) Any suggestions or help will be greatly appreciated.

Thanks, Tony
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2008
Added on Aug 23 2007
33 comments
11,779 views