java执行sql报错 ora-00917 missing comma ,可是sql在后台打印出来的我贴在plsql中就可以执行
调试bug的时候批量从excel表中取数据insert进数据库,少数几条报错missingcomma,当把其中excel某个字段的长度缩短之后(这个字段在数据库定义中不超...
调试bug的时候批量从excel表中取数据insert进数据库, 少数几条报错 missing comma,当把其中excel某个字段的长度缩短之后(这个字段在数据库定义中不超长),却可以执行。
String sql_a = "insert into t_zckp_xxb (zckp_id,gjrq,zckp_mc,yz,yzje,nzje,ljzj,zjnx,kmdm,syrq,jz,jggg,cqzz,bmmc,ddmc,fzr,dqdm,stz,yxbz,drpcls) values(";
sql_a = sql_a + "'"+zckp_id+"','"+gjrq+"','"+zckp_mc+"',"+yz+","+yzje+","+nzje+","+ljzj+","+zjnx+",'"+kmdm+"',";
sql_a = sql_a + "'"+syrq+"',"+jz+",'"+jggg+"','"+cqzz+"','"+bmmc+"','"+ddmc+"','"+fzr+"','"+dqdm+"','"+stz+"','1','"+drpcls+"'";
sql_a = sql_a + ")";
奇怪的是当我把sql最后的“)”与上一行合并时 程序也不报错了。。
String sql_a = "insert into t_zckp_xxb (zckp_id,gjrq,zckp_mc,yz,yzje,nzje,ljzj,zjnx,kmdm,syrq,jz,jggg,cqzz,bmmc,ddmc,fzr,dqdm,stz,yxbz,drpcls) values(";
sql_a = sql_a + "'"+zckp_id+"','"+gjrq+"','"+zckp_mc+"',"+yz+","+yzje+","+nzje+","+ljzj+","+zjnx+",'"+kmdm+"',";
sql_a = sql_a + "'"+syrq+"',"+jz+",'"+jggg+"','"+cqzz+"','"+bmmc+"','"+ddmc+"','"+fzr+"','"+dqdm+"','"+stz+"','1','"+drpcls+"')";
望达人解答! 展开
String sql_a = "insert into t_zckp_xxb (zckp_id,gjrq,zckp_mc,yz,yzje,nzje,ljzj,zjnx,kmdm,syrq,jz,jggg,cqzz,bmmc,ddmc,fzr,dqdm,stz,yxbz,drpcls) values(";
sql_a = sql_a + "'"+zckp_id+"','"+gjrq+"','"+zckp_mc+"',"+yz+","+yzje+","+nzje+","+ljzj+","+zjnx+",'"+kmdm+"',";
sql_a = sql_a + "'"+syrq+"',"+jz+",'"+jggg+"','"+cqzz+"','"+bmmc+"','"+ddmc+"','"+fzr+"','"+dqdm+"','"+stz+"','1','"+drpcls+"'";
sql_a = sql_a + ")";
奇怪的是当我把sql最后的“)”与上一行合并时 程序也不报错了。。
String sql_a = "insert into t_zckp_xxb (zckp_id,gjrq,zckp_mc,yz,yzje,nzje,ljzj,zjnx,kmdm,syrq,jz,jggg,cqzz,bmmc,ddmc,fzr,dqdm,stz,yxbz,drpcls) values(";
sql_a = sql_a + "'"+zckp_id+"','"+gjrq+"','"+zckp_mc+"',"+yz+","+yzje+","+nzje+","+ljzj+","+zjnx+",'"+kmdm+"',";
sql_a = sql_a + "'"+syrq+"',"+jz+",'"+jggg+"','"+cqzz+"','"+bmmc+"','"+ddmc+"','"+fzr+"','"+dqdm+"','"+stz+"','1','"+drpcls+"')";
望达人解答! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询