[英]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();
You can't use bind variables with DDL, such as ALTER SEQUENCE
.您不能将绑定变量与 DDL 一起使用,例如ALTER SEQUENCE
。 You'll have to concatenate incval
onto the string.您必须将incval
连接到字符串上。
There shouldn't be any risk of SQL injection if incval
is an int
or a long
.如果incval
是int
或long
,则不应存在 SQL 注入的任何风险。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.