INSERT(str,pos,len,newstr): Replaces the string str with the substring beginning at position pos and len characters long replaced by the string newstr : INSERT « String Functions « MySQL Tutorial






Returns the original string if pos is not within the length of the string.

Replaces the rest of the string from position pos if len is not within the length of the rest of the string.

Returns NULL if any argument is NULL.

mysql>
mysql> SELECT INSERT('ABCDEFG', 3, 4, 'ZZZ');
+--------------------------------+
| INSERT('ABCDEFG', 3, 4, 'ZZZ') |
+--------------------------------+
| ABZZZG                         |
+--------------------------------+
1 row in set (0.00 sec)

mysql>








23.16.INSERT
23.16.1.INSERT(str,pos,len,newstr): Replaces the string str with the substring beginning at position pos and len characters long replaced by the string newstr
23.16.2.INSERT('ABCDEFG', -1, 4, 'ZZZ');
23.16.3.INSERT('ABCDEFG', 3, 100, 'ZZZ');
23.16.4.Use Insert function to insert text to the first_name