oracle - 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 " ); sqlstmt.append( " ? " ); pstmt.setlong(1, incval); pstmt.execute();
you can't use bind variables ddl, such alter sequence. you'll have concatenate incval onto string.
there shouldn't risk of sql injection if incval int or long.
Comments
Post a Comment