samedi 22 mars 2014

SQL Error 1406 Data too long for column 'concatenado' on local mysql mac osx, it works on Windows perfectly


Vote count:

0




I have a function which allow me to concat each tittle (titulo) of a table size between 50 and 90 words each, until my subtittle (subtitulo) is null initially this has varchar(5000), I discover the return of this function do not reach aprox 4000 words, this function is working good in Windows 8 without any problem,I changed to work in MacBook pro osx 10.8.2, I have installed the Mysql latest version as well as I recently changed installing the MAMP , but still with the same problem of the colum , I changed with the type with Text,Long Text,BLOB ,longBlob my IDE shows me the message 'running ...' without stoping, why my function work perfectly in Windows and not in Mac, I have this problem since 4 days ago.


Also my SELECT @@max_allowed_packet shows me on the result 1048576 it that the problem? if so how to add more size in Mac osx.


DELIMITER $$


CREATE DEFINER=root@localhost FUNCTION fn_avanceFisico_ConcatenadoTitulos(pIdTitulo int) RETURNS varchar(5000) CHARSET utf8 BEGIN DECLARE concatenado varchar(5000);


set concatenado='';


WHILE (ifnull(pIdTitulo,0) <> 0) do

SELECT concat_ws(' Subtitulo',concatenado,titulo),subtitulo into concatenado,pIdTitulo FROM ttitulo WHERE idTitulo=pIdTitulo; END while;


RETURN concatenado;


END;


Cheers



asked 41 secs ago






Aucun commentaire:

Enregistrer un commentaire