You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-contains.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,28 @@ The `contains()` function tests whether a string attribute contains a specific s
13
13
String comparisons in XPath constraints are generally case-insensitive, but this can depend on the collation setting for some databases. See [Case-Sensitive Database Behavior](/refguide/case-sensitive-database-behavior/) for more information.
14
14
{{% /alert %}}
15
15
16
+
## Syntax
17
+
18
+
The syntax is as follows:
19
+
20
+
```
21
+
contains ( attribute, string_expression )
22
+
```
23
+
24
+
### attribute
25
+
26
+
`attribute` specifies the attribute to test in. Attribute must be of the **String** type.
27
+
28
+
### expression
29
+
30
+
`string_expression` specifies the value to test for being contained in the attribute. It can be a string literal or an expression that returns a string.
31
+
32
+
{{% alert color="info" %}}
33
+
In the case the `attribute` is empty or `NULL`, the function will always return `false`, independent of the value of `string_esxpression`.
34
+
35
+
In the case the `string_expression` is empty, it is treated as an empty string. The function is then equivalent to ```attribute != ''```.
36
+
{{% /alert %}}
37
+
16
38
## Example
17
39
18
40
This query returns all the customers from which the name contains the string `an`:
0 commit comments