{"id":128,"date":"2013-07-04T11:09:29","date_gmt":"2013-07-04T16:09:29","guid":{"rendered":"https:\/\/bijoos.com\/oraclenotes\/?p=128"},"modified":"2026-02-07T15:35:10","modified_gmt":"2026-02-07T21:35:10","slug":"oracledb12c-new-feature-use-of-sequence-value-in-column-default","status":"publish","type":"post","link":"https:\/\/bijoos.com\/oraclenotes\/2013\/128\/","title":{"rendered":"OracleDB12c New Feature: Use of Sequence Value in Column DEFAULT"},"content":{"rendered":"<p><em><strong>Happy 4th of July!<\/strong><\/em><\/p>\n<p>In the 12c new feature a day series, I discussed the &#8220;Identity Column&#8221; feature yesterday. Extension to that feature is now you can use sequence \u00a0pseudo-column NETXTVAL or CURRVAL as DEFAULT value for a column in table definition. In the prior releases to be able to do this, a trigger and some coding was required&#8230;<\/p>\n<p>If the sequence is owned by another user, appropriate access should be granted on the sequence [privilege, synonym, qualify with schema name].<\/p>\n<p>You can have only one IDENTITY column per table, buy you may create more than one column with DEFAULT sequence values.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Example:<\/strong><\/span><\/p>\n<pre class=\"lang:default highlight:0 decode:true\">CREATE TABLE T1 (\nX1 NUMBER DEFAULT SCOTT.MYSEQ.NEXTVAL,\nX2 VARCHAR2);<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Happy 4th of July! In the 12c new feature a day series, I discussed the &#8220;Identity Column&#8221; feature yesterday. Extension to that feature is now you can use sequence \u00a0pseudo-column NETXTVAL or CURRVAL as DEFAULT value for a column in table definition. In the prior releases to be able to do this, a trigger and &#8230; <a title=\"OracleDB12c New Feature: Use of Sequence Value in Column DEFAULT\" class=\"read-more\" href=\"https:\/\/bijoos.com\/oraclenotes\/2013\/128\/\" aria-label=\"Read more about OracleDB12c New Feature: Use of Sequence Value in Column DEFAULT\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[133],"tags":[],"class_list":["post-128","post","type-post","status-publish","format-standard","hentry","category-oracledb"],"acf":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/comments?post=128"}],"version-history":[{"count":1,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/128\/revisions"}],"predecessor-version":[{"id":3034,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/128\/revisions\/3034"}],"wp:attachment":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/media?parent=128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/categories?post=128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/tags?post=128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}