Home » Developer & Programmer » Reports & Discoverer » Error in Formula Column
Error in Formula Column [message #610070] Mon, 17 March 2014 06:30 Go to next message
HAMMAD SHAHID
Messages: 5
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 Go to previous messageGo to next message
Littlefoot
Messages: 19335
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 Go to previous messageGo to next message
HAMMAD SHAHID
Messages: 5
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 Go to previous message
cookiemonster
Messages: 10853
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.
Previous Topic: prevent Report log entries into the cache folder
Next Topic: report background engine stopped working
Goto Forum:
  


Current Time: Thu Jul 31 00:26:25 CDT 2014

Total time taken to generate the page: 0.09505 seconds