Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: query trigger
Originally posted by Drukqs
> andrewst wrote in news:2901810.1053445949_at_dbforums.com:"]news:2-
> 901810.1053445949_at_dbforums.com:[/url]
>
> > SELECT pcnr, n
> > INTO :testblock.pc, :testblock.number
> > FROM
> > (
> > SELECT pcnr, sum(number) AS n
> > FROM orders
> > GROUP BY pcnr
> > ORDER BY sum(number) desc
> > )
> > WHERE ROWNUM = 1;
>
> This gives this error when I compile:
> Encountered the symbol "ORDER" when expecting one of the following
> .(),*@ and so on........
>
> What shall I do?
OK, so probably your version of Forms doesn't support ORDER BY within
inline views either. But that's OK, you can do this instead:
FOR r IN
( SELECT pcnr, sum(number) AS n
FROM orders
GROUP BY pcnr
ORDER BY sum(number) desc
)
LOOP
:testblock.pc := r.pcnr;
:testblock.number := r.n;
EXIT;
END LOOP;
-- Posted via http://dbforums.comReceived on Wed May 21 2003 - 14:56:31 CDT
![]() |
![]() |