📜  更改序列设置当前值 oracle - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:30.729000             🧑  作者: Mango

代码示例1
SELECT LAST_NUMBER FROM ALL_SEQUENCES WHERE SEQUENCE_NAME = 'seq_name';

ALTER SEQUENCE seq_name INCREMENT BY 100;    -- Value to reach desired value - 1
SELECT seq_name.nextval FROM dual;            -- Reinitialize value to desired
ALTER SEQUENCE seq_name INCREMENT BY 1;        -- Back to init step