Error in Formula Column [message #610070] |
Mon, 17 March 2014 06:30  |
HAMMAD SHAHID
Messages: 6 Registered: March 2010 Location: PAKISTAN
|
Junior Member |
|
|
Hello everyone..
I am using following code in formula column report 6i:
function CF_Count_Stats_saleFormula return Number is
vstatus_sale number;
begin
select count(status_sale) into vstatus_sale
from
(
SELECT o.ordno,o.status_sale
FROM ordr o,
(
SELECT ordno FROM ORDR where party='9500' ORDER BY o.ordno DESC) v
WHERE ROWNUM<=5
and o.ordno=v.ordno);
return (vstatus_sale);
end;
----------------------------------
When i compile this code a error occur on order by.
Same code run on sql successfully.
Why Order By Clause problem in above formula column?
Thanks and regards
|
|
|
Re: Error in Formula Column [message #610072 is a reply to message #610070] |
Mon, 17 March 2014 06:37   |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Which error is it?
[EDIT]
By the way, doesn't this (simpler) query return the same result?
SELECT COUNT (status_sale)
FROM ( SELECT o.ordno, o.status_sale
FROM ordr o
WHERE o.party = '9500'
ORDER BY ordno DESC)
WHERE ROWNUM <= 5;
[Updated on: Mon, 17 March 2014 06:42] Report message to a moderator
|
|
|
Re: Error in Formula Column [message #610073 is a reply to message #610072] |
Mon, 17 March 2014 06:43   |
HAMMAD SHAHID
Messages: 6 Registered: March 2010 Location: PAKISTAN
|
Junior Member |
|
|
Error 103 at line 10, column 52
Encountered this symbol "ORDER" When expecting one of the following
. * @ % & - + / mod rem with an exponent (**) and or group having intersect
minus start union where connect ||
|
|
|
Re: Error in Formula Column [message #610077 is a reply to message #610073] |
Mon, 17 March 2014 07:23  |
cookiemonster
Messages: 13966 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
It may be that the really old version of reports you are using doesn't support order by in sub-queries. In which case you need to create a database function that returns the count and call that from the formula column.
|
|
|