Auto-increment in Oracle without using a trigger

后端 未结 9 1970
野的像风
野的像风 2020-11-28 09:52

What are the other ways of achieving auto-increment in oracle other than use of triggers?

9条回答
  •  孤城傲影
    2020-11-28 10:21

    In addition to e.g. FerranB's answer:
    It is probably worth to mention that, as opposed to how auto_incement works in MySQL:

  • sequences work database wide, so they can be used for multiple tables and the values are unique for the whole database
  • therefore: truncating a table does not reset the 'autoincrement' functionaltiy

提交回复
热议问题