What you *really* want to do is dynamically construct the SQL for the exact data you want. Writing generic statements that handle multiple choices are almost always *slower*. However, I don't use Oracle's applications, so maybe the proper solution is not available to you.
If not, then here's a WHERE clause with some binds:Then again, if you can't do binds (again, I don't know exactly how bad Oracle apps are), then someone's going to have to tell me what you 'can' do.Code:C.Zone = :Zone AND ( :Phase1 = 1 AND C.Phase = 1 ) OR ( :Phase2 = 1 AND C.Phase = 2 ) OR ( :Phase3 = 1 AND C.Phase = 3 ) OR ( :Phase1 IS NULL AND :Phase2 IS NULL AND :Phase3 IS NULL )
- Chris




Reply With Quote