{"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_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[133],"tags":[],"class_list":["post-128","post","type-post","status-publish","format-standard","hentry","category-oracledb"],"acf":[],"jetpack-related-posts":[{"id":102,"url":"https:\/\/bijoos.com\/oraclenotes\/2013\/102\/","url_meta":{"origin":128,"position":0},"title":"OracleDB12c New Feature: Identity Column","author":"Biju","date":"July 3, 2013","format":false,"excerpt":"Let's talk about a \"developer\" feature today. If you have a need to generate a column value [mostly primary key] based on a sequence, in pre-12c Oracle database we have to create a number data type column in the table, and use a sequence that is separately created. There is\u2026","rel":"","context":"In &quot;Oracle Database&quot;","block_context":{"text":"Oracle Database","link":"https:\/\/bijoos.com\/oraclenotes\/category\/oracledb\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1513,"url":"https:\/\/bijoos.com\/oraclenotes\/2015\/1513\/","url_meta":{"origin":128,"position":1},"title":"Oracle Tidbits &#8211; March 2015","author":"Biju","date":"April 1, 2015","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d (#oratidbit) published at\u00a0https:\/\/www.facebook.com\/oraclenotes\u00a0on weekdays\u00a0in March\u00a02015. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 Hope you find these helpful to learn something new or to remind you of its existence and use\u2026\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1619,"url":"https:\/\/bijoos.com\/oraclenotes\/2015\/1619\/","url_meta":{"origin":128,"position":2},"title":"Invisible Columns in Oracle Database 12c","author":"Biju","date":"October 14, 2015","format":false,"excerpt":"In May 2014, the following #oratidbit relating to invisible columns were tweeted. In #DB12c, you can make a column in table as INVISIBLE. When you make it invisible, the COL# column in COL$ dictionary is updated to 0, thus is not included in the \"SELECT *\" or \"INSERT INTO VALUES\",\u2026","rel":"","context":"In &quot;Oracle Database&quot;","block_context":{"text":"Oracle Database","link":"https:\/\/bijoos.com\/oraclenotes\/category\/oracledb\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":393,"url":"https:\/\/bijoos.com\/oraclenotes\/2014\/393\/","url_meta":{"origin":128,"position":3},"title":"OracleNotes TidBits &#8211; May 2014","author":"Biju","date":"May 31, 2014","format":false,"excerpt":"According to the dictionary, meaning of \"tidbit\" is \"a small and particularly interesting item of gossip or information\"... hope you find the \"Oracle TidBits\" published at https:\/\/www.facebook.com\/oraclenotes\u00a0interesting... Here is a compilation of the tidbits published in May 2014. You will also see these tidbits, one tidbit at a time, for\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"Oracle TidBit","src":"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2014\/05\/TidBit-300x123.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1480,"url":"https:\/\/bijoos.com\/oraclenotes\/2014\/1480\/","url_meta":{"origin":128,"position":4},"title":"Oracle Tidbits &#8211; December 2014","author":"Biju","date":"December 31, 2014","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d (#oratidbit) published newly at\u00a0https:\/\/www.facebook.com\/oraclenotes\u00a0on weekdays\u00a0in December\u00a02014. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 Hope you find these helpful to learn something new or to remind you of its existence and\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":20,"url":"https:\/\/bijoos.com\/oraclenotes\/2011\/20\/","url_meta":{"origin":128,"position":5},"title":"Passwords are Case Sensitive in Oracle11g","author":"Biju","date":"September 26, 2011","format":false,"excerpt":"The passwords in Oracle11g are case sensitive. All new users created in the 11g database have case sensitive password by default. For databases upgraded from earlier releases, the passwords are not case sensitive for existing accounts. They become case sensitive when you change password. A new column PASSWORD_VERSIONS is added\u2026","rel":"","context":"In &quot;Oracle Database&quot;","block_context":{"text":"Oracle Database","link":"https:\/\/bijoos.com\/oraclenotes\/category\/oracledb\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_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}]}}