Symptom
- Custom query is not returning expected results.
- Using selection parameter option "EQ" on a text field returns multiple records that match a pattern, as if "CP" (contains pattern) were used.
- Query may end with a "timeout" error when unintended large result sets are returned.
Environment
- SAP Business ByDesign
- SAP Cloud for Customer
Reproducing the Issue
- In this example we use an email activity with a custom BeforeSave event containing a custom query which searches for phone numbers which match exactly.
- Open an email record in the system and switch to edit mode.
- Make a change and save to run a BeforeSave ABSL script that executes a QueryByElements.
- In the ABSL, build selection parameters similar to: BONameParams.Add(StringVariable, "I", "EQ", "user's phone");
- Execute the query. Observe that records with phone values containing parts of "user's phone" are returned, not only the exact match.
Cause
The data type of the searched attribute is STRING without a fixed length. For such text parameters, the Hana database converts the operator EQ (equals to) to CP (contains pattern), which leads to pattern-based matching. This is expected system behavior.
Resolution
This is expected behavior for variable-length STRING fields; no action is required.
See Also
- refer to: Query Execution (Business Logic)
- refer to: 3507148 - About regex queries
Keywords
querybyelements, selectionparams, eq operator, cp operator, contains pattern, equals, string field, variable length, text field, hana conversion, abs l, pdi query, phone field, exact match, timeout, performance, Custom Script, ABSL. Custom Query, , KBA , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , Problem
SAP Knowledge Base Article - Public