Updated on 2026-11-06 GMT+08:00
lengthb
The lengthb function is used to calculate the byte length of a string str.
Similar function: length. The length function returns the length of a string.
Syntax
lengthb(string )
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| str | Yes | STRING | The input string. |
Return Values
Returns a value of type BIGINT.
- If str is not of type STRING, BIGINT, DOUBLE, DECIMAL, or DATETIME, an error is returned.
- If str is NULL, NULL is returned.
Example Code
Returns 5.
select lengthb('hello'); Returns NULL.
select lengthb(null);
Parent topic: String Functions
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot