Re: Quick question about PL/SQL CURSOR definition and ORDER BY

From: Andy Klock <andy_at_oracledepot.com>
Date: Sun, 26 Feb 2012 09:42:55 -0500
Message-ID: <CADo_RaN9K3wqQpznfzFOYdtdggVKb9QT4tbGrRG0_dSgke6YUA_at_mail.gmail.com>



Looks like you are using a subquery when (from what I can tell in your example) one is not needed. Why not leave the parenthesis out altogether?  CURSOR x1 IS
   SELECT c1
   FROM T1
   ORDER BY c2;

Use them when you actually need them.

For reference:

http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/sqloperations.htm#i3317

On Sun, Feb 26, 2012 at 1:17 AM, Mani <manips2002_at_gmail.com> wrote:

> Hi,
>
> I had a question about using ORDER BY in a CURSOR declaration..
>
> The following cursor declaration appears to not work.. the compilation
> error is about missing right paranthesis..
>
> CURSOR x1 IS
> (SELECT c1
> FROM T1
> ORDER BY c2);
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Sun Feb 26 2012 - 08:42:55 CST

Original text of this message