How to create id with AUTO_INCREMENT on Oracle?

后端 未结 16 1875
死守一世寂寞
死守一世寂寞 2020-11-21 04:52

It appears that there is no concept of AUTO_INCREMENT in Oracle, up until and including version 11g.

How can I create a column that behaves like auto increment in Or

16条回答
  •  孤城傲影
    2020-11-21 05:47

    Oracle Database 12c introduced Identity, an auto-incremental (system-generated) column. In the previous database versions (until 11g), you usually implement an Identity by creating a Sequence and a Trigger. From 12c onward, you can create your own Table and define the column that has to be generated as an Identity.

    The following article explains how to use it:

    Identity columns - A new entry in Oracle Database 12c

提交回复
热议问题