MySQL Update data reminder truncated incorrect INTEGER value: Error

Source: Internet
Author: User
Tags mysql update tagname truncated


There is no way to find a solution on the Internet. But Baidu went to a personal blog and found a way to solve it.



An error SQL statement



Update XX user Set Qq_password = ' xx_id ' & photo = ' img ' WHERE email = ' EMAILX '



And then this is the correct execution statement



Update XX user Set Qq_password = ' xx_id ', photo = ' img ' WHERE email = ' EMAILX '



Let's change the &, comma, please.



Later to see a foreigner to use storage has also encountered such a problem



Truncated incorrect INTEGER value: ' 1| Blondes '



Stored Procedure functions


The code is as follows


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
   &nbs p;  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;



Use process


The code is as follows

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.111cn.net as a character before the concatenation, since your may is mixing Bina Ry and Non-binary strings. Like


  code is as follows

SELECT ( Cast (Group_concat (CONCAT (TagID as Char), ' | ', tagName) separator ' ~ ') as CHAR (10000) CHARACTER SET UTF8))

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.