Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Krondeau

New Member
Registered:
Posts: 8
Reply with quote  #1 

I'm using a text variable to hold a string of values separated by commas, and I'm trying to use this as the IN clause for my row selection. Basically, it would be something like Table1.FieldA IN '%txtString'. The %txtString contains something like "abc, def, ghi". I tried putting single quotes around the values as I build the string, but doesn't work either. The filtering of this grid depends on the user's security which I am returning from a VB script, so it could be one or multiple values in the filter.

0
mohnshine

Avatar / Picture

Senior Veteran
Registered:
Posts: 270
Reply with quote  #2 
you have not configured the IN clause correctly

it should be
    IN('value1','value2','value3')
 
when you use a variable
    IN(%variable)
 
with the value of %variable being
    'value1','value2','value3'
 
If you can, a nested Select would be better
    IN(Select MyColumn From MyTable Where MyCriteria = 'something')

__________________
Your best practice does not conform with my best practice.
0
Krondeau

New Member
Registered:
Posts: 8
Reply with quote  #3 

Thanks, when I put the parentheses and quotes in the variable string, it worked. So, the varaible needs to be "('abc', 'edf', 'ghi')"

0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #4 
Typically we replace the comma in a comma delimited list with quote-comma-quote using the %Replace() function. For full fault-trapping, replace each quote with two quotes first, or the SQL will fail.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!