Hello.
I need to write fuzzy search statement .
my requirement is not to take into account parameters which are empty.
let's say:
et_data = select distinct score( ) as score, partner, name_first, name_last
from ZVWCDSDEMO
where
(
contains( name_first, :iv_first_name, fuzzy( 0.5 ) ) and
contains( name_last, :iv_last_name, fuzzy( 0.5 ) )
)
ORDER BY score( ) desc;
if iv_first_name is empty I want the select to work like this:
et_data = select distinct score( ) as score, partner, name_first, name_last
from ZVWCDSDEMO
where
(
****contains( name_first, :iv_first_name, fuzzy( 0.5 ) ) and
contains( name_last, :iv_last_name, fuzzy( 0.5 ) )
)
ORDER BY score( ) desc;
there are lots of combinations ( I have more parameters than 2 ).
I want to avoid "IF"s.
Is it a way not to take the parameter into account when it's empty?
Thank You, Łukasz.