Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Dynamic Order By Clause
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 NowReceived on Wed Nov 21 2001 - 12:28:14 CST
![]() |
![]() |