Data truncation: Truncated incorrect double value: MySQL update

Source: Internet
Author: User

From http://blog.csdn.net/iwtbavcp/article/details/6455704

It's really a cold post that solves my big problem.

 

MySQL update sdata truncation: Truncated incorrect double value :?? S

Recently I used JSP and MySQL to create something and encountered a problem:

When the update statement is used, data truncation: Truncated incorrect double value :?? Error.

One Of My SQL statements is: Update users set userpwd = '000000' and userrealname = 'admin' where username = 'guoweiin'; this execution is fine.

The other SQL statement is in the same format as the previous one. The difference is that there are many and connected columns, and the above error occurs.

After searching for Baidu for half a day, there was no ending.

I did not expect that at last, a very cold post solved my problem.

Replace and in the update statement with a comma.

For example

Update users set userpwd = '000000', suserrealname = 'admin' where username = 'guoweiin ';

If more columns exist, use commas to join.

 

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.