From the course: Oracle Database 12c: Advanced SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using identity columns

Using identity columns - Oracle Database Tutorial

From the course: Oracle Database 12c: Advanced SQL

Start my 1-month free trial

Using identity columns

- [Instructor] In addition to using Oracle sequences to generate values when inserting data to tables, Oracle version 12C also introduces the concept of identity columns, which behave similarly to Oracle sequences but simplified a process of generating new values when rows are inserted into our database tables. Identity columns are special columns that can be thought of as built-in table sequences. You create a new table in your database, and specify that one of the columns is an identity column. Oracle will create a sequence on your behalf and associate it with the table unlike regular sequences, so that new values will be generated for each row you insert. Let's see an example. Going to our exercise file, let's copy the Create Table statement and paste it to our SQL developer window. Note the ID column in this table is a special column. As you can see it is specified as Number Generated Always As Identity which is the specification that makes this column an identity column. It…

Contents