故障报告
1. 问题(故障)描述
[ERR] 2021-11-07 13:04:59 exec sql>INSERT INTO “ZCBUS_001”.”ZBOMC_CUSTOMER”(“CUSTOMERID”,”ID”,”NAME”,”WWW”,”IMG”,”BACKGROUND_IMG”,”REMARKS”,”VALID”,”UPDATETIME”,”LOGO”,”MSGLEVEL”,”SHOWTYPE”,”SERIAL_NUMBER”,”CLIENT_IP”,”TYPE”,”STATUS”) VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16) err:ZCBUS-1000: OCI ret -1 at file oralib.c:1083, 172.17.58.145:1521/oracle12c.
ORA-01400: cannot insert NULL into (“ZCBUS_001”.”ZBOMC_CUSTOMER”.”REMARKS”)
OCI Error - OCI_ERROR
error at file[oralib.c] line[1088], ZCBUS-1000: OCI ret -1 at file oralib.c:1083, 172.17.58.145:1521/oracle12c.
2. 问题(故障)原因
MYSQL数据库中,空字符串为一个字符,null为没有数据
ORACLE数据库中,空字符串和null同等价值
3. 解决
手工修改字段允许为空即可
alter table “ZCBUS_001”.”ZBOMC_CUSTOMER” modify REMARKS null;
- 注:如果字段为非主键字段可以手工修改字段为空,如果字段为主键或者为以约束,不允许为空,则需要修改生产数据,将数据改为非空。软件层跳过这条记录,即可。
最后点击异常,恢复数据复制。