Re: How to loop SQL "select WTKEY_SEQ.nextval from dual"
Rather than looping the statement, it would be easier to just change the increment value for the sequence. The statement to change the increment value is:
Alter sequence WTKEY_SEQ increment by <New Increment Value>;
Just replace '<New Increment Value>' with the difference between the current sequence value and the value you want the sequence to be. After changing the increment value, then you just need to run 'select WTKEY_SEQ.nextval from dual' once, and it will increment to your target value. Afterward, make sure to set the increment value back to 1, by running: Alter sequence WTKEY_SEQ increment by 1;