当前位置: 首页 > 知识库问答 >
问题:

DB2sqlcode-433、SQLSTATE 22001

经和洽
2023-03-14

触发器“orddba.ord_ir_in”中的触发SQL语句发生错误。返回的错误信息包括SQLCODE“-433”、SQLSTATE“22001”和消息标记“actionarea_unitbal_chg_flagcancel_date”。sqlcode=-723,sqlstate=09000,driver=3.66.46

declare columnNames varchar(5000);
SET columnNames='';
SET columnNames = 'value1' ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value2') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value3') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value14') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value5') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value6') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value6') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value8') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value9') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value10') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value11') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value12') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value13') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value14') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value15') ;
SET columnNames = CONCAT(columnNames, '|') ;
SET columnNames = CONCAT(columnNames, 'value16') ;

共有1个答案

裴硕
2023-03-14

从你的评论来看:

如果我计算varchar中的字符数小于5000,DB2的计算方式似乎不同,因此失败了。然后我将datatype更改为CLOB,然后它就可以正常工作了

这是因为varchar的长度以字节为单位,而clob的长度以字符(文档)为单位。

 类似资料:

相关问答

相关文章

相关阅读