Jump to content
Changes to the Jaspersoft community edition download ×

How to pass the (java.util.Collection ) parameter to MS SQL Stored Procedure


eagleeye

Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You may have to write a query executer that extends the basic JdbcQueryExecuter functionality for the SQL query language. I remember in JRS 3.5.x we had implemented that but I am not sure if it is still necessary for the latest version of JRS since there seems to be better support for parameters containing a list of values (ie. the $X{} parameter replacement).

Link to comment
Share on other sites

  • 3 years later...

This is working for reports, but not if you want to make a topic of the report:

Input control:

Name: inp_abc
Class: java.util.Collection
Default Value: new ArrayList()

String list variable (parameter)

Name: var_abc
Class: java.lang.String
Default Value: $P{var_abc}.join(",",$P{inp_abc} )

Then pass the var_abc to the proc.

in the proc, you can use the following syntax to get the result:

select * from table

where ','+@var_abc+',' like '%,'+TableColumn+',%';

Link to comment
Share on other sites

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...