PeakGen PeakGen - 3 months ago 9
SQL Question

Passing parameters to `In` clause

I am trying to pass parameters to Jasper report

clause. Below is what I tried in Jasper reports.

SELECT * FROM `medication` WHERE $X{IN,idMeidication,$P!{parameter_name}}

However it is keep on saying the
does not exists. If I convert my Jasper SQL to normal SQL, it will look like this

SELECT * FROM `medication` WHERE idMedication IN (1,2,3)

I am using Jaspersoft Studio and how can I fix this?


I think the right solution will be:

SELECT * FROM `medication` WHERE $X{IN,idMeidication,parameter_name}

without $P!{}

In this way i use it in my reports.