{"id":129,"date":"2010-05-05T12:50:12","date_gmt":"2010-05-05T16:50:12","guid":{"rendered":"http:\/\/www.dev-notes.com\/blog\/2010\/05\/05\/manually-incrementing-an-oracle-sequence-by-a-defined-amount\/"},"modified":"2010-05-05T12:50:12","modified_gmt":"2010-05-05T16:50:12","slug":"manually-incrementing-an-oracle-sequence-by-a-defined-amount","status":"publish","type":"post","link":"https:\/\/www.dev-notes.com\/blog\/2010\/05\/05\/manually-incrementing-an-oracle-sequence-by-a-defined-amount\/","title":{"rendered":"Manually incrementing an Oracle sequence by a defined amount"},"content":{"rendered":"<p>Let&#8217;s say you have a sequence object created called <i>myschema.seq_mysequence<\/i> which has the next value of 3000 and it normally increments 1 at a time, and let&#8217;s say that you need to reserve all numbers between 3000 and 4000 for a special purpose, thus you need to manually advance the sequence from 3000 to 4000.  This is how you can increment the sequence 1000:<\/p>\n<pre class=\"code\">\n-- First, alter the object so the next increment will jump 1000 instead of just 1.\nalter sequence myschema.seq_mysequence increment by 1000;\n\n-- Run a select to actually increment it by 1000\nselect myschema.seq_mysequence.nextval from dual;\n\n-- Alter the object back to incrementing only 1 at a time\nalter sequence myschema.seq_mysequence increment by 1;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This note shows how you can instruct Oracle to advance an Oracle sequence by an amount that you define.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-129","post","type-post","status-publish","format-standard","hentry","category-oracle"],"_links":{"self":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":0,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/129\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/media?parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/categories?post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/tags?post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}