Mega Code Archive

 
Categories / MySQL Tutorial / String Functions
 

INSERT(str,pos,len,newstr)

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>