What is MySQL OCTET_LENGTH() function?

MySQLMySQLi Database

MySQL OCTET_LENGTH() function is used to count the number of characters in a string. Basically, it is a synonym of LENGTH() function. Its syntax is as follows −

Syntax

OCTET_LENGTH(Str)

Here, Str is a string whose length of characters has to be returned.

Example

mysql> Select OCTET_LENGTH('My name is Ram')As Str_Length;
+------------+
| Str_Length |
+------------+
|         14 |
+------------+
1 row in set (0.00 sec)
raja
Published on 20-Feb-2018 10:24:10
Advertisements