mysql更新数据提醒Truncated incorrect INTEGER value:错误
发布:smiling 来源: PHP粉丝网 添加日期:2014-09-25 15:14:19 浏览: 评论:0
在mysql中更新数据时出现了Truncated incorrect INTEGER value错误,但仔细查看语句没什么问题,于时又运行还是有错,然后直接利用phpmyadmin生成一条才发现php用多了直接把习惯放在了mysql中.
在网上都找不到什么解决的方法,但是百度到一个个人博客后找到了解决的方法,报错的sql语句,代码如下:
update xx user set qq_password = 'xx_id' & photo = 'img' WHERE email = 'emailx'
然后这个是正确的执行语句,代码如下:
update xx user set qq_password = 'xx_id',photo = 'img' WHERE email = 'emailx'
把&改为,逗号就好了,后来看一老外使用存储过得也碰到这样的问题.
Truncated incorrect INTEGER value:'1|Blondes'
存储过程函数,代码如下:
- DELIMITER $$
- DROP FUNCTION IF EXISTS `fnObjectTagGetObjectTags` $$
- CREATE DEFINER=`root`@`%` FUNCTION `fnObjectTagGetObjectTags`(_objectType int, _objectId bigint) RETURNS varchar(2048) CHARSET utf8
- BEGIN
- DECLARE _outObjectTags VARCHAR(2048);
- SET _outObjectTags =
- (
- SELECT (CAST(GROUP_CONCAT(CONCAT(tagId, '|', tagName) separator '~') AS CHAR(10000) CHARACTER SET utf8)) AS objectTagList
- FROM
- (
- SELECT tagId, tagName
- FROM objectTag
- INNER JOIN tag
- ON tagId = objectTagTagId
- WHERE objectTagObjectType = _objectType
- AND objectTagObjectId = _objectId
- AND objectTagIsDisabled = 0
- AND objectTagIsActive = 1
- AND tagIsDisabled = 0
- AND tagIsActive = 1
- ) as subQuery
- );
- RETURN _outObjectTags;
- END $$
- DELIMITER ;
使用过程,代码如下:
- SELECT fnObjectTagGetObjectTags(3, album.albumId)
- FROM album
- WHERE fnObjectTagGetObjectTags(3, album.albumId) IS NOT NULL
- AND albumIsDisabled = 0
- AND albumIsActive = 1
- Try an explicit cast of just the tagId www.phpfensi.com as a character before the concatenation, since you may be mixing binary and non-binary strings. Like
- SELECT (CAST(GROUP_CONCAT(CONCAT(CAST(tagId AS CHAR), '|', tagName) separator '~') AS CHAR(10000) CHARACTER SET utf8))
Tags: Truncated incorrect INTEGER
- 上一篇:mysql数据1135报错问题解决办
- 下一篇:mysql中权限参数说明
相关文章
- ·mysql保存数据提示1366 Incorrect string value:(2014-09-24)
- ·解决Incorrect integer value: for column id; at row 1(2014-09-27)
- ·mysql错误:Warning: #1366 Incorrect string value:解决方法(2014-09-27)
- ·MySQL数据库-错误1166 Incorrect column name(2014-09-27)
- ·mysql提示:Incorrect integer value: for column id at row 1报错.(2014-10-09)
- ·mysql中Incorrect key file for table: Try to repair it(2014-10-09)
- ·mysql中文提示Incorrect string value: xB1xB1xBExA9(2014-10-13)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)