This content has been marked as final. Show 2 replies
we dont know what exactly you are trying to solve, are you appending these conditons dynamically?
may be this inbuilt oracle package : UTL_INADDR can help you...
Please post complete query / requirement.
SELECT CASE WHEN UTL_INADDR.GET_HOST_NAME = 'xur0000dor' THEN 'UAT' WHEN UTL_INADDR.GET_HOST_NAME = 'xur0001dor' THEN 'OAT' END FROM DUAL;
Note:Not tested the code
Select tb1.*,tb2.* from tb1 join tb2 on (tb1.col1=tb2.col1) join (select case when global_name='UATDB' then 'UAT' when global_name='QATDB' then 'QAT' else 'OTHERDB' end DB_NAME from global_name) DB on 1=1 where (DB.DB_NAME='UATDB' and tb1.CREATED_DT > 23-OCT-2012) or (DB.DB_NAME='QATDB' and tb1.application_no in ('1' ,'2')) or (DB.DB_NAME='OTHERDB');