Hi,
wanted to include where clause conditionally (depends on variable value passed to procedure)
Code:
select main_acnt_code as code, main_acnt_name as name
from fm_main_account
where MAIN_FRZ_FLAG = 'N'
and case in_Code
when 'CAPEX' THEN main_class_code_05 = 'Y';
when 'MAIN_ACC2' THEN main_class_code_02 = 'Y';
end case;
but error reads as "missing keywords " at line "
when'CAPEX'THENmain_class_code_05 = 'Y';"
any idea how can we make select statement's where clause dynamic ??