Skip to content

Commit ea0dd00

Browse files
authored
[DOCS] SQL: Move null handling to arg descriptions (#74255) (#74261)
#74201 documents `null` handling to the arg descriptions of several string functions. This PR moves pre-existing docs for `null` handling and similar edge case handling for string functions to arg descriptions for consistency. Relates to #74193
1 parent fc52651 commit ea0dd00

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

docs/reference/sql/functions/string.asciidoc

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ CHAR(code) <1>
5858
--------------------------------------------------
5959
*Input*:
6060

61-
<1> integer expression. If `null` or negative, the function returns `null`.
61+
<1> integer expression between `0` and `255`. If `null`, negative, or greater
62+
than `255`, the function returns `null`.
6263

6364
*Output*: string
6465

65-
*Description*: Returns the character that has the ASCII code value specified by the numeric input. The value should be between 0 and 255; otherwise, the return value is data source–dependent.
66+
*Description*: Returns the character that has the ASCII code value specified by the numeric input.
6667

6768
[source, sql]
6869
--------------------------------------------------
@@ -102,12 +103,12 @@ CONCAT(
102103
--------------------------------------------------
103104
*Input*:
104105

105-
<1> string expression
106-
<2> string expression
106+
<1> string expression. Treats `null` as an empty string.
107+
<2> string expression. Treats `null` as an empty string.
107108

108109
*Output*: string
109110

110-
*Description*: Returns a character string that is the result of concatenating `string_exp1` to `string_exp2`. `null` input strings are treated as empty strings.
111+
*Description*: Returns a character string that is the result of concatenating `string_exp1` to `string_exp2`.
111112

112113
[source, sql]
113114
--------------------------------------------------
@@ -223,13 +224,17 @@ LOCATE(
223224
--------------------------------------------------
224225
*Input*:
225226

226-
<1> string expression
227-
<2> string expression
228-
<3> integer expression; optional
227+
<1> string expression. If `null`, the function returns `null`.
228+
<2> string expression. If `null`, the function returns `null`.
229+
<3> integer expression; optional. If `null`, `0`, `1`, negative, or not
230+
specified, the search starts at the first character position.
229231

230232
*Output*: integer
231233

232-
*Description*: Returns the starting position of the first occurrence of `pattern` within `source`. The optional `start` specifies the character position to start the search with. The first character position in `source` is indicated by the value 1. Not specifying `start` or specifying it as `null`, any negative value, 0 or 1, starts the search at the first character position. If `pattern` is not found within `source`, the value 0 is returned.
234+
*Description*: Returns the starting position of the first occurrence of
235+
`pattern` within `source`. The optional `start` specifies the character position
236+
to start the search with. If the `pattern` is not found within `source`, the
237+
function returns `0`.
233238

234239
[source, sql]
235240
--------------------------------------------------
@@ -441,8 +446,8 @@ STARTS_WITH(
441446

442447
*Output*: boolean value
443448

444-
*Description*: Returns `true` if the source expression starts with the specified pattern, `false` otherwise. The matching is case sensitive.
445-
If either parameters is `null`, the function returns `null`.
449+
*Description*: Returns `true` if the source expression starts with the specified
450+
pattern, `false` otherwise. The matching is case sensitive.
446451

447452
[source, sql]
448453
--------------------------------------------------

0 commit comments

Comments
 (0)