Purpose
LENGTHB() returns the length of a string in bytes.
Syntax
LENGTHB(char)
Parameters
char specifies the string whose length in bytes is calculated.
Return type
The return type is NUMBER.
Examples
The UTF-8 string éOceanBase contains the character é, which occupies 2 bytes, and nine single-byte characters. Therefore, the string is 11 bytes long:
obclient> SELECT LENGTHB('éOceanBase') AS result FROM DUAL;
+--------+
| RESULT |
+--------+
| 11 |
+--------+
1 row in set