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

Home -> Community -> Mailing Lists -> Oracle-L -> CASE substitution in WHERE clause

CASE substitution in WHERE clause

From: Jesse, Rich <Rich.Jesse_at_quadtechworld.com>
Date: Fri, 23 Jul 2004 10:23:33 -0500
Message-ID: <FBE1FCA40ECAD41180400050DA2BC54004E93BA7@qtiexch2.qgraph.com>


Hey all,

Now that we're up to 9.2.0.5 on HP/UX 11i, I'm trying to make use of = some of the new features. Some devs want to be able to select something = like this:

SELECT *
FROM my_warehouse
WHERE warehouse IN=20

        CASE :in_whse WHEN '00' THEN ''' '',''00''' ELSE :in_whse END

If the parameter supplied is '00', have the select filter based on (' = ','00'). If not, filter on what parameter was passed in.

In order to take advantage of indexing, I don't want to apply functions = to the filter. Or would it be "better" to use dynamic SQL?

Thoughts anyone?

TIA,
Rich

Rich Jesse                           System/Database Administrator
Rich.Jesse_at_quadtechworld.com         QuadTech, Sussex, WI USA

=20



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Fri Jul 23 2004 - 10:20:13 CDT

Original text of this message

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