andey.wei Posted March 14, 2014 Share Posted March 14, 2014 I have two inputs. "Sites" & "Controllers". Controllers are the children of Sites. "Controllers" Custom Input Queryselect id, name from controllers where $X{IN, site_id, site_id_1}[/code]When site_id_1 has nothing selectedI expect: the return set to be emptyI get: all the controllers in the DBQuestion: How do I make the query return no results when site_id_1 has no options selected?What I've tried:select id, name from controllers where (case when ($P{site_id_1} = null) then id = 0 else $X{IN, site_id, site_id_1} end)[/code]However I don't know the data type of $P{site_id_1}, thus I don't know how to write an expression to test if the parameter is empty.Thanks in Advance! Link to comment Share on other sites More sharing options...
hozawa Posted March 16, 2014 Share Posted March 16, 2014 Why don't you just check the input parameter? Do something like in the following thread but replace MyVerifiedParam default to something that'll return no result.http://community.jaspersoft.com/questions/537583/validate-input-controls Link to comment Share on other sites More sharing options...
andey.wei Posted March 17, 2014 Author Share Posted March 17, 2014 I would like to check the parameter, but I'm not sure how. I tried "CASE WHEN ($P{site_id_1} = NULL)", but it always will fail that check. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now