在通过insert into 与句往数据库插入一条数据的时候
报错org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into PSCancelTList(PkgCode,FrontTranCode,FrontID,FrontDate,FrontSerial,AcpDate,SndBankCode,MsgID,SRFlag,SysLevel,SysCode,MsgType,PrimAcpDate,PrimSndBankCode,PrimMsgID,PrimPkgCode,PrimSRFlag) VALUES('307',?,?,?,?,?,?,?,?,'2',?,'1',?,?,?,?,?)]; ORA-00001: 违反唯一约束条件 (EDZF.PSCANCELTLIST_IDX2)
; nested exception is java.sql.SQLException: ORA-00001: 违反唯一约束条件 (EDZF.PSCANCELTLIST_IDX2)请问高手如何解决 。
报错org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into PSCancelTList(PkgCode,FrontTranCode,FrontID,FrontDate,FrontSerial,AcpDate,SndBankCode,MsgID,SRFlag,SysLevel,SysCode,MsgType,PrimAcpDate,PrimSndBankCode,PrimMsgID,PrimPkgCode,PrimSRFlag) VALUES('307',?,?,?,?,?,?,?,?,'2',?,'1',?,?,?,?,?)]; ORA-00001: 违反唯一约束条件 (EDZF.PSCANCELTLIST_IDX2)
; nested exception is java.sql.SQLException: ORA-00001: 违反唯一约束条件 (EDZF.PSCANCELTLIST_IDX2)请问高手如何解决 。
你這樣要插入成功肯定要在另外2個表裏插入數據
在插入的2個數據的時候要先先查這樣如果表與表之間約束很多的時候情況下 自己寫SQL巨麻煩!!!