drop procedure if exists foo;
delimiter #
create procedure foo(in p_string longtext)
begin
select length(p_string) as len;
end#
delimiter ;
set @s = '5,14,16,20,34,38,39,41,45,53,59,61,63,....');
call foo(@s);
+-------+
| len |
+-------+
| 14479 |
+-------+
1 row in set (0.00 sec)
см. http://pastie.org/1685774 для полного сценария!