LENGTH4

LENGTH4 in SQL is a function used to return the length of a data string in UTF-32 units. This value represents the number of UTF-32 characters present in the given data string.

Example

SELECT LENGTH4('Oracle') AS "Length4"
FROM dual;

Output

Length4
-------
6

Explanation

The LENGTH4 function in Oracle SQL returns the length of a string, measuring it in characters, rather than bytes. The function returns 6, indicating that the string ‘Oracle’ consists of 6 characters.

Example

SELECT LENGTH('SQL SERVER') AS LENGTH;

Output

7

Explanation

The LENGTH function in SQL Server is used to return the number of characters in a specified string. In the provided example, the LENGTH function returns the number of characters in the string ‘SQL SERVER’, which is 7.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.