![](/img/trans.png)
[英]stmt.executeUpdate() returns java.sql.SQLException: ORA-01722: invalid number
[英]ERROR java.sql.SQLException: ORA-01722: invalid number while running a Prepared Statement to alter a Sequence
sqlStmt = new StringBuffer(" ALTER SEQUENCE " );
sqlStmt.append( ServerContext.getSchemaName() );
sqlStmt.append("SEQ_EDCD_TRACE_NUM");
sqlStmt.append( " INCREMENT BY " );
sqlStmt.append( " ? " );
pstmt.setLong(1, incval);
pstmt.execute();
您不能将绑定变量与 DDL 一起使用,例如ALTER SEQUENCE
。 您必须将incval
连接到字符串上。
如果incval
是int
或long
,则不应存在 SQL 注入的任何风险。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.