Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> CASE substitution in WHERE clause
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