I have a string like this: 0002000B0016001M001S002A
(variable string length but divisible by 4)
I need to split it (in MySql) in chunks of 4 characters
Espected result :
@my_var = '0002'
@my_var = '000B'
@my_var = '0016'
@my_var = '001M'
@my_var = '001S'
@my_var = '002A'
I think SUBSTR() can be employed here but I don't know how to manage next position in a loop in mysql
Or some equivalent like chunk_split() in PHP for MySql?