Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Multiple values per Parameter
sdlemaster
Hi all,
I have a question about parameters. My client wants to enter in multiple work order numbers into the work order parameter like this:
5000,5001,5002,5003
In my dataSet I can say
select * from workorders where wonum in (params["wonum"]). However, in Oracle to use the IN statement each value has to have single quotes around it like this:
'5001','5002','5003'
So the client is not going to want to enter in these single quotes. Is there a way to modify my query or is there a split method that would allow me to add single quotes?
Also I wanted to mention I have to do this in version 2.1.2 so a list box with the option of "allow multiple values" is not available to me. I really need a replace method but have not used a method inside the beforeOpen before.
Find more posts tagged with
Comments
mwilliams
Hi sdlemaster,
If you put something like this in the beforeOpen script or in the "property binding" section in the dataSet editor, it should add the single quotes for you in the query by splitting at the commas and rejoining with ',':
this.queryText = "select field1, field2, field3, field4 "
+ "from table "
+ "where parameterizedField IN('" + params["Country"].value.split(",").join("','") + "')";