Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL puzzler

Re: PL/SQL puzzler

From: Peter Schneider <peter.schneider_at_okay.net>
Date: 1998/01/28
Message-ID: <34cfb0e7.12041484@news.okay.net>#1/1

On Wed, 28 Jan 1998 14:02:03 -0600, "Charles A. Christiansen, Jr." <charles_at_iconstructs.com> wrote:

>Hi all,
>
>I'm having a bit of trouble getting an ORDER BY clause into a cursor.
>This is my PL/SQL code:
>
>CURSOR c_ipf IS (SELECT EntryID, OrderNum FROM T1
> WHERE MainID = Main_ID AND ParentID = Parent_ID AND LevelNum =
>Level_Num AND OrderNum >= Order_Num
> ORDER BY OrderNum DESC);
>
>What I get from the compiler is:
>
>PLS-00103: Encountered the symbol "ORDER" when expecting one of the
>following: .()*@%& (. . .) the symbol ")" was substituted for "ORDER" to
>continue.
>

Hi Charles,

with that outer pair of brackets around your cursor declaration, Oracle obviously assumes it is a subquery or an inline view, in which ORDER BY is not allowed. If you remove these brackets, it should work all right.

HTH
Peter

-- 
Peter Schneider
peter.schneider_at_okay.net
Received on Wed Jan 28 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US