开发者

mysql: Illegal mix of collations in a store procedure problem

I get this error: Illegal mix of coll开发者_StackOverflow中文版ations (greek_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '=' when I call this store procedure of mine:

DELIMITER //

CREATE PROCEDURE setVehicleStats (vehID text, vehStatus text, vehLat double, vehLon double)
BEGIN

    UPDATE vehicles SET st=vehStatus, lat=vehLat, lon=vehLon WHERE id=vehID;

END//

although I have no problem when I run an UPDATE query directly: UPDATE vehicles SET st='Καλημέρα' WHERE id='A001';

I have tried to explicitly declare the charset for each column, etc. The problem seems to occur only when I call the procedure! Any help ?? Thanks...


I think the problem is with the collation of the vehStatus parameter. It seems the server or the connection default character set is set to latin1 and the greek_general_ci collation uses the greek character set (ISO 8859-7). Try declaring your parameter like this:

vehStatus text character set greek
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜