Oracle Database 12c: sequence.nextval as default and identity columns

Finally! I can count how many times I’ve seen questions like this one.

The new Oracle 12c now allows to define a table with the sequence.nextval directly in the in-line column definition:

 

But Oracle has fixed this twice, in the new release it’s possible to use identity columns as well, avoiding the necessity to create explicitly a new sequence:

I’ve said “explicitly” because actually a sequence is created with a system-generated name, so you’ll still need to deal with sequences.

 

cheers

Ludo

Be Sociable, Share!
The following two tabs change content below.

Ludovico

Oracle ACE and Senior Consultant at Trivadis SA
After being DBA Team Leader in Italy for a while, Ludovico works as Senior Database Specialist on the full Oracle stack (Clusterware, RAC, ASM), MySQL (Replication, DRBD, Galera), SQLServer and PostgreSQL.

2 thoughts on “Oracle Database 12c: sequence.nextval as default and identity columns

  1. Pingback: Oracle Database 12c (12.1) Installation and New Features | DBLinks Consulting Ltée

  2. Pingback: Oracle Database 12c (12.1) Installation and New Features | DBLinks Consulting LTDDBLinks Consulting LTD

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">