In function INSERT(str, Pos, len, newstr), what would be the result if ‘len’ is not within the length of the rest of string?

MySQLMySQLi Database

In case if ‘len’ is not within the length of the rest of the string then MySQL INSERT() function will continue to remove the characters until the end of the original string.

Example

mysql> Select INSERT('myteststring',3,15,'name');
+------------------------------------+
| INSERT('myteststring',3,15,'name') |
+------------------------------------+
| myname                             |
+------------------------------------+
1 row in set (0.00 sec)
raja
Published on 21-Feb-2018 09:03:53
Advertisements