[英]getting error SQLCODE=-10, SQLSTATE=42603, SQLERRMC='),
performing following query in java script 在Java脚本中执行以下查询
String sql = "insert into personal values('"+models.getResourceId()+"','"+models.getFname()+"','"+models.getMname()+"','"+models.getLname()+"','"+models.getGender()+"','"+models.getDob()+"','"+models.getFthname()+"','"+models.getEmail()+"','"+models.getMobile_no()+"')";
i don't know what to correct. 我不知道该怎么纠正。
the query is in DB2 该查询在DB2中
You should use parameter binding. 您应该使用参数绑定。 Give us the whole sql after you put it together. 将它们组合在一起后,给我们整个SQL。 You likely used a '
in one of the other variables and didn't escape that one. 您可能在其他变量之一中使用了'
,并且没有对该变量进行转义。
Are you sure that you are using javascript for accessing the database? 您确定使用JavaScript来访问数据库吗? I'm not aware of such a driver/possiblity. 我不知道这样的驱动程序/可能性。 And it would be new to me that javascript knows types like String
. 对我来说,javascript知道String
类的类型对我来说是新的。
根据文档,“该语句包含未正确终止的字符串常量”。有关更多详细信息,请访问http://lasanthals.blogspot.com/2012/09/db2-error-codes.html 。
输入值包含内部可能包含单引号,例如:'RPG's
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.