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
# Incorrect use of 'LIKE' (IncorrectUseLikeInQuery)
2
2
3
3
<!-- Блоки выше заполняются автоматически, не трогать -->
4
-
## Description
4
+
## Описание диагностики
5
5
<!-- Описание диагностики заполняется вручную. Необходимо понятным языком описать смысл и схему работу -->
6
6
7
-
## Examples
8
-
<!-- В данном разделе приводятся примеры, на которые диагностика срабатывает, а также можно привести пример, как можно исправить ситуацию -->
9
-
10
7
When using the operator `LIKE` in the query text, it is allowed to use only
11
8
- constant string literals
12
9
- query parameters
@@ -15,10 +12,62 @@ It is forbidden to form a template string using calculations, use string concate
15
12
16
13
Queries in which the control characters of the operator template `LIKE` are in query fields or in calculated expressions are interpreted differently on different DBMSs.
17
14
15
+
## Examples
16
+
<!-- В данном разделе приводятся примеры, на которые диагностика срабатывает, а также можно привести пример, как можно исправить ситуацию -->
17
+
18
+
### String concatenation by language features
19
+
20
+
Allowed:
21
+
22
+
```
23
+
Field LIKE "123%"
24
+
```
25
+
26
+
Not allowed:
27
+
28
+
```
29
+
Field LIKE "123" + "%"
30
+
Field LIKE Table.Template
31
+
```
32
+
33
+
### Operator template control characters LIKE are found in query fields or in calculated expressions
0 commit comments