loop... until the value you want   select my_ID.nextval from dualend loop;Edit the sequence is a direct way.