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: mixing dynamic native sql and static sql?

Re: mixing dynamic native sql and static sql?

From: John Russell <netnews2_at_johnrussell.mailshell.com>
Date: Sat, 13 Apr 2002 05:40:17 GMT
Message-ID: <pqgfbuommtjm1ldoo2ajj29pju9hoos082@4ax.com>


On 12 Apr 2002 02:16:24 -0700, plm_at_gmx.li (Peter Mutsaers) wrote:
>Hello,
>
>I need to parametrize the ordering from a large query.

You can use something like

ORDER BY DECODE(test_expression, case1, column1, case2, column2, case3, column3, ...)

to evaluate a complex condition and substitute the appropriate column to order by in each case. The expression might be a function that performs an arbitrary number of tests. Don't know how well this performs on a large result set or whether it's practical to make a function-based index on the entire DECODE() or just the expression being evaluated.

John

--
Got an Oracle database question?
Try the search engine for the database docs at:
http://tahiti.oracle.com/
Received on Sat Apr 13 2002 - 00:40:17 CDT

Original text of this message

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