kburns Posted June 29, 2011 Share Posted June 29, 2011 Two things regarding using the LIKE condition and concatenating parameter strings: 1. How can I use the LIKE condition with a parameter. For example, in normal SQL: select * from my_table where column_value LIKE 'SOMETHING%' I'd like to insert my report's parameter for SOMETHING, so that I get anything that begins with my parameter's value.For example: select * from my_table where column_value LIKE $P{my_param} select * from my_table where column_value LIKE '$P{my_param}%' select * from my_table where column_value LIKE $P{my_param}% 2. How can I concatenating parameters with strings. For example, my parameter's value is "foo" and I'd like to get rows where the value is "foobar". I assume its something like: select * from my_table where column_value = $P{my_param}+'bar' Any ideas? Post Edited by kburns at 06/29/2011 20:47 Link to comment Share on other sites More sharing options...
despec Posted June 30, 2011 Share Posted June 30, 2011 I think in this case you want the variable with an exclamation point, i.e., $P!{my_param}. David 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