Saturday, March 2, 2013

Identity columns to debut in 12C

Identity columns are set to debut in the upcoming new version of oracle database. You no longer had to create sequence and write before insert triggers to auto update primary key columns. The following syntax is set to work in 12c and will do everything for you.

SQL> CREATE TABLE TEST (
ID GENERATE AS IDENTITY COLUMN,
.
.
.
);

Behind the scenes oracle will create the sequence and will update the column when new records are entered.

This is not something new or out of the box as other databases like SQL SERVER and MySQL have this feature for quite sometime. Oracle however relied on the hard programmatic way until now. 12c is set to change that.

No comments:

Post a Comment