Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: mixing dynamic native sql and static sql?
Thomas offered you a working solution which will need only one step.
You will get ordered ref cursor as the result. You can also do it by using
your static query as inline view for your ordering query, something like
this:
select * from (your static query) [order by ...]
-- Vladimir Zakharychev (bob@dpsp-yes.com) http://www.dpsp-yes.com Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications. All opinions are mine and do not necessarily go in line with those of my employer. "Peter Mutsaers" <plm_at_gmx.li> wrote in message news:uwuvbtpme.fsf_at_mutsaers.com...Received on Mon Apr 15 2002 - 00:49:19 CDT
> >> "John" == John Russell <netnews2_at_johnrussell.mailshell.com> writes:
>
> John> You can use something like
>
> John> ORDER BY DECODE(test_expression, case1, column1, case2, column2,
> John> case3, column3, ...)
>
> Yes, but in my case, I have to order on multiple columns (for some
> inputs) and some of the coumns are asc, some are desc. Seems quite
> impossible with the order by decode construct.
>
> If only I could do it in two steps, first creating a ref cursor using
> a static query, then using a small dynamic query that uses this ref
> cursor and adds the (dynamic) order by stuff.
>
>
> --
> Peter Mutsaers | Dübendorf | UNIX - Live free or die
> plm_at_gmx.li | Switzerland | Sent via FreeBSD 4.5