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

Home -> Community -> Usenet -> c.d.o.server -> Re: Dynamic Order By Clause

Re: Dynamic Order By Clause

From: Mladen Gogala <mgogala_at_earthlink.net>
Date: Wed, 21 Nov 2001 18:28:14 GMT
Message-ID: <pan.2001.11.21.13.28.10.977.5565@earthlink.net>


In article <7e1c2f8c.0111210812.416e524f_at_posting.google.com>, "Prakash C N" <prakashcn_at_hotmail.com> wrote:

> Hi,
>
> Can i have a dynamic order by clause, following is my example which is
> in a package
>
> select * from tab1
> order by columnname_in
>
> columnname_in will have the actual column name giving the
> flexibility of ordering by any column which is in tab1 with out
> hardcoding the column name
>
> Thanks in advance
> -Regards
> Prakash C N

No, you can not have that because parser needs to define the execution path and it annot do that without knowing which column is used for ordering. You can, however, use 'execute immediate' to simulate such behavior. May the force be with your shared pool if you decide to do so.

-- 
Mladen Gogala
I love the smell of napalm in the morning. It smells like victory.
Apocalypse Now
Received on Wed Nov 21 2001 - 12:28:14 CST

Original text of this message

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