一个专注于大数据技术架构与应用分享的技术博客

DB2执行SQL语句报错:DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0101N The statement was not processed because a limit such as a memory limit,an SQL limit,or a database limit was reached. SQLSTATE=54001

很不幸,执行一个简的SQL语句,又双叕报错了!

DB2真的是一个坑爹的数据库,经常出一些莫名其妙的错误。

执行的SQL语句为:

CREATE TABLE TEST_SCHEMA.TEST1 LIKE TEST_SCHEMA.TEST2;

根据一张旧表,创建一张相同结构的新表,结果报错如下:

DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
SQL0101N The statement was not processed because a limit such as a memory limit,an SQL limit,or a database limit was reached. SQLSTATE=54001

经分析,报错原因为来源表字段个数太多,有300多个字段。导致触发了某个数据库限制的阀值,所以报错了。

对于SQLSTATE=54001这个错误,在执行DB2的SQL语句中,经常遇到。一般来说,可能是语句太复杂,需要对SQL进行简化。

对于上面的报错,我的处理方法为,修改LIKE的用法为直接创建表:

CREATE TABLE TEST_SCHEMA.TEST1(
    col1...
    col2...
    col3...
    ...
);
赞(0)
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《DB2执行SQL语句报错:DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0101N The statement was not processed because a limit such as a memory limit,an SQL limit,or a database limit was reached. SQLSTATE=54001》
文章链接:https://macsishu.com/db2
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。