报错如下:
### Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-02290: check constraint (SKUSER.SYS_C0013649) violated
### The error may involve gov.chinatax.ctims.dao.mapper.CbFpJsMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO CB_FP_JS ( FPDM, FPHM, SBBH, SBLX_DM, CSLX_DM, BS_NSRSBH, KPRQ, KPSJ, TSPZ, FPZTBZ, XSFSBH, XSFMC, GMFSBH, GMFMC, WSPZH, ZFRQ, ZFSJ, JE, SE, JSHJ, BZ, SKR, JYM, YFPDM, YFPHM, FPQM, YQBZ, KJLX, BSFS, JSR_DM, JSR_MC, JSSJ, SWJG_DM, JSSWJG_DM, BMB_BBH, SYSLBS, MXTS, BZSJE, CXSWJG_DM ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-02290: check constraint (SKUSER.SYS_C0013649) violated
数据入库,XSFMC不可为空,数据库提示(IS NULL)。修改表结构,该字段可以为空,后报此错误;
原因:数据库存在检查约束,该字段不可以空;
查询检查约束的方法:
1 可视化工具->表结构设计->检查;
2 执行sql
SELECT * FROM user_constraints WHERE table_name = 'CB_FP_JS';
查到删除即可:
删除check语句:
ALTER TABLE TABLENAME DROP CONSTRAINT SYS_C0069731