Products | Versions |
---|---|
TIBCO Collaborative Information Manager | - |
Not Applicable | - |
Resolution:
Description:
============
With the out-of-the-box rulebase constructs it is not possible to escape special characters such as '_' while using a like clause. Say for example, if the like clause uses '%A_B%' the '_' would not be taken as a literal. If the column against which like clause is subjected has the following values, A_B, ABC, both A_B and ABC would be returned when ABC is not an expected result.
Environment:
===========
TIBCO Collaborative Information manager (CIM) 8.X.X.
Cause:
=====
The out-of-the-box constructs in rulebase do not provide a way to escape special characters.
Resolution:
==========
The following approach can be used as a workaround. Notice the ‘where’ clause usage. With this approach the ‘_’ character would be escaped and only records having A_B would be returned.
<declare>
<var>LIKES</var>
<link type="catalog">
<literal>LIKES</literal>
</link>
</declare>
<constraint>
<name>DropDown</name>
<description>DropDown</description>
<usefor>
<var>ATTR1</var>
</usefor>
<action>
<select novalue="default">
<table distinct="false" source="sql">
<literal>LIKES/ATTR1</literal>
<where type="sql">
<const type="string">LIKES.CATTR1 LIKE '%A/_B%' escape '/'</const>
</where>
</table>
</select>
</action>
</constraint>
</rulebase>
Attachments:
===========
None.
References:
==========
None.