简体   繁体   English

第2行的列'descr'的数据太长

[英]Data too long for column 'descr' at row 2

When I try this sql statement to execute 当我尝试执行此sql语句时

update claim cl set search_field = (select  concat(cl.claim_description,' ', cl.legal_basis,' ',co.name) from contact co where cl.probable=1 and cl.search_field is null and co.id=cl.contact_id)

I get error above, and there is no column named descr . 我在上面遇到错误,并且没有名为descr列。 There is column named claim_description but it isn't descr 有一个名为claim_description列,但不是descr

Does anyone have hint? 有人提示吗? Thank you 谢谢

Instead of a correlated subquery in an UPDATE statement try: 代替在UPDATE语句中使用相关子查询,请尝试:

UPDATE claim cl, contact co
SET cl.search_field = CONCAT (cl.claim_description,' ',cl.legal_basis,' ',co.NAME)          
WHERE cl.probable = 1
    AND cl.search_field IS NULL
    AND co.id = cl.contact_id

Thanks for your help, I found solution for this. 感谢您的帮助,我为此找到了解决方案。 Trigger on update was problem it was trying to update variable descr which was too short. 更新触发是问题,它试图更新太短的变量descr。 It looks like brushing teeth really helps in programming :) 看起来刷牙确实有助于编程:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM