简体   繁体   English

DB2 LOAD修饰符-GeneratedOverride或IdentityOverride

[英]DB2 LOAD Modifier - GeneratedOverride or IdentityOverride

I am performing a DB2 load, and I am struggling to understand the impact of using GeneratedOverride over IdentityOverride. 我正在执行DB2加载,并且正在努力了解使用GeneratedOverride对IdentityOverride的影响。 When I run the following command: 当我运行以下命令时:

db2 load from tab123.ixf of ixf replace into application.table_abc

All rows are rejected, with the following error being the culprit: 所有行都被拒绝,而导致以下错误的原因是:

SQL3550W The field value in row row-number and column column-number is not NULL, but the target column has been defined as GENERATED ALWAYS. SQL3550W行row-number和column column-number中的字段值不为NULL,但目标列已定义为GENERATED ALWAYS。

So to try and step around this, I executed : 因此,为解决这一问题,我执行了:

db2 load from tab123.ixf of ixf modified by identityoverride replace into application.table_abc IXF的tab123.ixf的db2负载已被identityoverride修改并替换为application.table_abc

But this immediately returned this error: 但这立即返回此错误:

SQL3526N The modifier clause "IDENTITY OVERRIDE" is inconsistent with the current load command. SQL3526N修饰符子句“ IDENTITY OVERRIDE”与当前的装入命令不一致。 Reason code: "3". 原因码:“ 3”。

From checking the reason code I see that the issue is "Generated or identity related file type modifiers have been specified but the target table contains no such columns." 通过检查原因码,我发现问题是“已指定生成的或与身份相关的文件类型修饰符,但目标表不包含此类列。” .. but the SQL3550W error seems to infer that the columns are generated always! ..但SQL3550W错误似乎推断出总是生成列!

The only way I can get these rows to commit to the table is to run.. 我可以将这些行提交到表的唯一方法是运行。

db2 load from tab123.ixf of ixf modified by generatedoverride replace into application.table_abc 从ixf的tab123.ixf的db2负载修改为generateoverride替换为application.table_abc

Can anyone enlighten me to why I am recieving the SQL3526N error, or what the implications of running generatedoverride are? 谁能启发我为什么收到SQL3526N错误,或者运行generateoverride的含义是什么?

Thanks for sticking with me.. 谢谢你陪我

Generated columns are not necessarily identity columns, apparently that's the case in your situation. 生成的列不一定是标识列,显然您的情况就是这种情况。 Check the CREATE TABLE syntax to see what are other ways to generate column values. 检查CREATE TABLE语法,以查看生成列值的其他方法。

By using the GENERATEDOVERRIDE option during the load you are obviously replacing (overriding) the generated values with those from the input file. 通过在加载期间使用GENERATEDOVERRIDE选项,您显然可以用输入文件中的值替换(替代)生成的值。

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

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