Jump to content
We've recently updated our Privacy Statement, available here ×

edigest

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by edigest

  1. Hi, I'm a newbie and I would like to know if there is a way to discard WHERE conditions when their parameters are null or empty, Example: SELECT * FROM table1 WHERE (FIELD1=$P!{PARAM1}) AND (FIELD2=$P!{PARAM2}) should be executed as SELECT * FROM table1 WHERE (FIELD1=$P!{PARAM1}) if $P!{PARAM2) is null or empty (empty string for strings, 0 for numbers) In another RAD tool that we are using this feature is called "REMOVE ON EMPTY PARAMETER" I know I can "embed" this behaviour directly in the query, but it becomes a pain if the query is rather complex like: SELECT * FROM table1 WHERE ( FIELD1=$P!{PARAM1} OR FIELD2=$P!{PARAM2} ) AND ( FIELD5<>$P!{PARAM2} OR FIELD6>$P!{PARAM3} OR FIELD7=$P!{PARAM4} ) The feature is VERY useful if we use the same query in many parametrized contexts (it avoids building and mantaining many smaller queries) Thank you in advance, M.
×
×
  • Create New...