Jump to content
Changes to the Jaspersoft community edition download ×

Using the LIKE condition and concatenating parameter strings


kburns

Recommended Posts

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...