3 Replies Latest reply on Oct 16, 2018 10:59 PM by Nishanth Jenifer

    Dynamic Parameter with condition in Custom SQL query

    Nishanth Jenifer

      I have a situation where I have to run the custom sql query based on filter criteria/parameter set


      Example SQL:


      select e.id,e.name,e.description from event e left join  d on d.disposition= e.disposition and org=0 left join  p on e.prod_id = p.prod_id where =1  and e.qty is not null


      if(parameters.productcode!='') then

           and p.product_code=Parameters.productcode


      order by e.event_id desc limit <Parameters.MinimumLimit>,<Parameters.MaximumLimit>


      I have to check the parameter value is selected or not and based on that I have to run the custom sql query in data source section


      Can someone help me to solve this problem?