将oracle中的主键更改为NUMBER GENERATED ALWAYS AS IDENTITY



是否可以更改oracle中的主键标识从NULL作为标识的默认生成生成始终作为身份

谢谢。

是;运行

alter table your_table modify pk_column generated always as identity;

例如:

SQL> create table a1
2    (id   number generated by default on null as identity,
3     ime  varchar2(20));
Table created.
SQL> alter table a1 modify id generated always as identity;
Table altered.
SQL>

相关内容

最新更新