JCKiran
Senior Member
Registered:1231842570 Posts: 58
Posted 1439892370
Reply with quote
#1
Hi, We are trying to pass a properly quoted string to a Query BO as shown below: WHERE efolderid IN (@param) and the param is prepared in script like this: @param = "'xxxxxxx','xxxxxxx','xxxxxxx'" However, this is not working. I tried all the possible ways to achieve this. But no luck. Can any one suggest how to do this
__________________ Kiran
praxkan
Veteran
Registered:1318006899 Posts: 142
Posted 1441026837
Reply with quote
#2
This is a common issue - not really a metastorm issue though. Parameters in queries dont support the IN clause. If you google this you'll find several clever/complex workarounds. One method we've tried before is to use a comma separated list to table function. That way you can build your list like you have and pass it into the query as a parameter. In the query you'd have something like select * from querytable where column in (comma_to_table(@yourParam)) PS - look for "pudf_stringlist_to_table" function. This does what i'm referring to above. I believe it ships with metastorm