为列截断的数据?

Data truncated for column?(为列截断的数据?)

本文介绍了为列截断的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更改 MySql 列的数据类型以存储 Twilio call ids (34字符字符串),我尝试手动更改该列中的数据:

After changing the data type of a MySql column in order to store Twilio call ids (34 char strings), I try to manually change the data in that column with:

update calls 
   set incoming_Cid='CA9321a83241035b4c3d3e7a4f7aa6970d' 
 where id='1';

但是,我收到一个错误,因为列的数据类型已正确修改,所以没有意义?

However I get an error which doesn't make sense seeing as the column's data type was properly modified?

<代码>|级别 |||代码 |留言<代码>|警告 |第1265章第 1 行incoming_Cid"列的数据被截断

推荐答案

您的问题是目前您的 incoming_Cid 列定义为 CHAR(1)CHAR(34).

Your problem is that at the moment your incoming_Cid column defined as CHAR(1) when it should be CHAR(34).

要解决此问题,只需发出此命令即可将列的长度从 1 更改为 34

To fix this just issue this command to change your columns' length from 1 to 34

ALTER TABLE calls CHANGE incoming_Cid incoming_Cid CHAR(34);

这是SQLFiddle演示

Here is SQLFiddle demo

这篇关于为列截断的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:为列截断的数据?

基础教程推荐