开发者

How to change Sequence LAST_NUMBER in Oracle [duplicate]

开发者 https://www.devze.com 2023-03-17 04:09 出处:网络
This question already has answers here: 开发者_如何学GoClosed 11 years ago. Possible Duplicate: How do I reset a sequence in Oracle?
This question already has answers here: 开发者_如何学GoClosed 11 years ago.

Possible Duplicate:

How do I reset a sequence in Oracle?

I would like to change one parameter of sequence LAST_NUMBER to some number, how can i do it through SQL query.

ALTER SEQUENCE MSG_MESSAGE_SEQUENCE RESTART WITH 97

And it is not working.


From here:

'select MSG_MESSAGE_SEQUENCE.nextval from dual' INTO l_val;

execute immediate
'alter sequence ' || p_seq_name || ' increment by 97 - ' || l_val || ' minvalue 97';
0

精彩评论

暂无评论...
验证码 换一张
取 消