Home » SQL & PL/SQL » SQL & PL/SQL » ORDER BY Clause error in cursor (9i, 9.0.1.1, XP)
ORDER BY Clause error in cursor [message #661443] Fri, 17 March 2017 12:52 Go to next message
billgates
Messages: 19
Registered: March 2017
Junior Member
Hey Fellas,
In a 6i form I am and trying to fetch last 5 issue numbers in a cursor from a table names ims_issue. Syntax is as follows

cursor a_cursor is
select * from (select issueno as sale from ims_issue where posted='T' and itemcode=:ims_issue.itemcode order by isssuedate desc) where rownum<=5 order by rownum;


If I run this statement in PLSQL Developer (Allround Automations) it works. But in forms 6i trigger it gives an error on "ORDER BY" in inner select statement. Error message is as follows

Error 103 at line 50, column 104
Encountered the symbol "ORDER" when expecting one of the following:
.()*@%&-+/
The symbol ")" was substituted for "ORDER" to continue.

Why is that and how to solve it. Please help.

I am posting this question in PLSQL Forum instead of Forms Forum because its a PLSQL problem in my thinking.
Re: ORDER BY Clause error in cursor [message #661447 is a reply to message #661443] Fri, 17 March 2017 13:39 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Where is line 50, column 104?

Quote:
order by rownum;
This is silly, result set is ALWAYS ordered by ROWNUM as ROWNUM is defined by the order in which the rows are returned.

The problem is that you are using a version that was desupported at the beginning of this century, was the worst Oracle has ever delivered, full of bugs and no one can remember if this error was the case 15 years ago, we now are 7 versions ahead, would you post in Microsoft forum a question about Windows Millenium or NT 3.51? Why don't you use a newer version?

Your version documentation is there. Search in it by yourself if this ORDER BY is allowed.

[Edit: missing word]

[Updated on: Sat, 18 March 2017 01:49]

Report message to a moderator

Re: ORDER BY Clause error in cursor [message #661449 is a reply to message #661447] Fri, 17 March 2017 13:44 Go to previous messageGo to next message
billgates
Messages: 19
Registered: March 2017
Junior Member
Your reply was something I was really looking for. There are some limitations due to which this old version is being used. But the help needed do not fall anywhere near what system we are using
Re: ORDER BY Clause error in cursor [message #661450 is a reply to message #661449] Fri, 17 March 2017 13:52 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
On trick that I used to use in the bad old days of using forms 6 was to put the query in a view and then simply use the view instead of the table.
Re: ORDER BY Clause error in cursor [message #661451 is a reply to message #661449] Fri, 17 March 2017 14:00 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
the help needed do not fall anywhere near what system we are using
This is a complete mystery for me what you mean by this.
Did you search in the documentation I pointed you to?
Or do you expect we search for you?

Re: ORDER BY Clause error in cursor [message #661452 is a reply to message #661451] Fri, 17 March 2017 14:15 Go to previous messageGo to next message
billgates
Messages: 19
Registered: March 2017
Junior Member
the help needed, do not fall, anywhere near, what system we are using.

Thanks anyways
Re: ORDER BY Clause error in cursor [message #661453 is a reply to message #661452] Fri, 17 March 2017 14:17 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

As far as I understand what you say, yes, the help depends on Oracle version, RDBMS and Forms.

Re: ORDER BY Clause error in cursor [message #661457 is a reply to message #661453] Fri, 17 March 2017 16:11 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
https://community.oracle.com/thread/4027639
Previous Topic: invalid option using INTERVAL( NUMTODSINTERVAL(1, 'DAY'))
Next Topic: ORA-14028
Goto Forum:
  


Current Time: Thu Mar 28 15:47:48 CDT 2024