This discussion is archived
5 Replies Latest reply: Aug 3, 2012 10:41 AM by 847670 RSS

The ORDER BY clause is invalid in views, inline functions, derived tables..

847670 Newbie
Currently Being Moderated
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 16001] ODBC error state: 37000 code: 8180 message: [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.. [nQSError: 16001] ODBC error state: 37000 code: 1033 message: [Microsoft][ODBC SQL Server Driver][SQL Server]The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000)

I have already tried to follow this thread below, but no change.
HI

In this specific report ran above the offending sql uses a CTE.

I am on 11.1.1.6.1, Windows Server 2008
Currently in testing phase in migration from 10g.

I know what the error means, just not how to resolve it or what setting may be causing this.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points