erik.dittert Posted October 17, 2017 Share Posted October 17, 2017 Hi,i need to us a collection parameter in my sql function, here the paramter:my query at the moment is this:the function expecting a integer array. how to pass the paramter correctly? thx!Erik Link to comment Share on other sites More sharing options...
hozawa Posted October 17, 2017 Share Posted October 17, 2017 Check IN and NOTIN Clauses.JasperReports provides a special syntax to use with a where condition: the IN and NOTIN clauses.The IN clause checks whether a particular value is present in a discrete set of values. Here is an example:SELECT * FROM ORDERS WHERE SHIPCOUNTRY IS IN ('USA','Italy','Germany')The set here is defined by the countries USA, Italy and Germany. Assuming we are passing the set of countries in a list (or better a java.util.Collection) or in an array, the syntax to make the previous query dynamic in reference to the set of countries is:SELECT * FROM ORDERS WHERE $X{IN, SHIPCOUNTRY, myCountries}where myCountries is the name of the parameter that contains the set of country names. The $X{} clause recognizes three parameters:[/code]http://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v640/using-parameters-queries Link to comment Share on other sites More sharing options...
erik.dittert Posted October 17, 2017 Author Share Posted October 17, 2017 i know this, but this works only in a where clause. but i need to call a function :( Link to comment Share on other sites More sharing options...
Peñarandix85 Posted October 17, 2017 Share Posted October 17, 2017 Don't know if this could be helpfull but when i use java.util.collection i specify the parameter this way: select * from table where $X{IN, columName, ParamName}I know it is in a where clause but apart of that it doesnt use the expression $P{param}. Link to comment Share on other sites More sharing options...
erik.dittert Posted October 18, 2017 Author Share Posted October 18, 2017 no, like i said, i must call a function with a intger array as parameter 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