Hello, I need help with some null that are being inserted in a table where they shouldn't be... pls, help!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alvaro_Acero
Posted On:   Wednesday, April 30, 2003 07:56 AM

ps = conn.prepareStatement( new StringBuffer(210).append( "UPDATE tsgd_evaluacion_acuerdo eva ").append( "SET eva.niv_codigo = ?, ").append( "eva.eva_modifica = ? ").append( "WHERE eva.eva_ano = ? and ").append( "eva.emp_codigo_evaluado = ? and ").append( "eva.emp_codigo_evaluador = ? and ").append( "eva.eva_acuerdo = ? ").toString()); for(int j = 0; j < myVector.size(); j++) { ps.setInt(1, Integer.parseInt(((Agreement)myVector.get(j)).getLevel().getCode())); ps.setString(2, ((Agreement)myVector.get(j)).isModificable() ? YES : NO); ps.setInt(3, anho);    More>>

ps = conn.prepareStatement(
new StringBuffer(210).append(
"UPDATE tsgd_evaluacion_acuerdo eva ").append(
"SET eva.niv_codigo = ?, ").append(
"eva.eva_modifica = ? ").append(
"WHERE eva.eva_ano = ? and ").append(
"eva.emp_codigo_evaluado = ? and ").append(
"eva.emp_codigo_evaluador = ? and ").append(
"eva.eva_acuerdo = ? ").toString());


for(int j = 0; j < myVector.size(); j++) {
ps.setInt(1, Integer.parseInt(((Agreement)myVector.get(j)).getLevel().getCode()));
ps.setString(2, ((Agreement)myVector.get(j)).isModificable() ? YES : NO);
ps.setInt(3, anho);
ps.setString(4, evaluado.getCode());
ps.setString(5, evaluador.getCode());
ps.setString(6, ((Agreement)myVector.get(j)).getDesc());
updatedRows += ps.executeUpdate();
}
conn.commit();




Is there any chance that a null is set in the column eva.niv_codigo?? I think there isn't, but sometimes(about a 2% on a Country network) it happens that a null appears on that column!!!



What maybe happening?


THANKS a lot!    <<Less

Seems like the code tag doesn't work too well :)

Posted By:   Alvaro_Acero  
Posted On:   Wednesday, April 30, 2003 08:00 AM

Sorry, this is the actual code:


ps = conn.prepareStatement(
new StringBuffer(210).append(
"UPDATE tsgd_evaluacion_acuerdo eva ").append(
"SET eva.niv_codigo = ?, ").append(
"eva.eva_modifica = ? ").append(
"WHERE eva.eva_ano = ? and ").append
( "eva.emp_codigo_evaluado = ? and ").append
( "eva.emp_codigo_evaluador = ? and ").append
( "eva.eva_acuerdo = ? ").toString());

for(int j = 0; j < myVector.size(); j++) {
ps.setInt(1, Integer.parseInt(((Agreement)myVector.get(j)).getLevel().getCode()));
ps.setString(2, ((Agreement)myVector.get(j)).isModificable() ? YES : NO);
ps.setInt(3, anho);
ps.setString(4, evaluado.getCode());
ps.setString(5, evaluador.getCode());
ps.setString(6, ((Agreement)myVector.get(j)).getDesc());
updatedRows += ps.executeUpdate();
}
conn.commit();
About | Sitemap | Contact