ORA-01008:并非所有变量都已绑定
public int update(zengShanGaiChaModel model) throws CommonException {
String inst = "insert into TB_BASIC_DCTB (DC_ID,DC_TIME,DC_TITLE,DC_CONTENT,BEIZHU) values (?,to_date(?,'yyyy-mm-dd'),?,?,?)";
String upd = "update TB_BASIC_DCTB set DC_TITLE=?,DC_TIME=to_date(?,'yyyy-mm-dd'),DC_CONTENT=?,BEIZHU=? where DC_ID=?";
if(model.getDC_ID() == null || model.getDC_ID().equals("")) {
Long key = commonMapper.queryMaxId("TB_BASIC_DCTB");
commonMapper.update(inst, new Object[]{
key,
model.getDC_TITLE(),
model.getDC_TIME(), //这里的变量与SQL语句不一样多。或者顺序不一样
model.getDC_CONTENT(),
model.getBEIZHU(),
});
} else {
commonMapper.update(upd, new Object[]{
model.getDC_TITLE(), //这里的变量与上面sql语句中的不一样。
model.getDC_TIME(),
model.getDC_CONTENT(),
model.getBEIZHU(),
model.getDC_ID()
});
}
return 1;
}
--转自

该贴由koei123转至本版2015-6-1 15:14:43
该贴由system转至本版2019-3-2 21:07:44