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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -