-1
How do I update the Sequence value?
Situation: I will create a Quence but it may be that this table is registered or not. Then how do I generate Quence 0 or then with value from which there is already record?
create Sequence S_SEG_EXE;
-1
How do I update the Sequence value?
Situation: I will create a Quence but it may be that this table is registered or not. Then how do I generate Quence 0 or then with value from which there is already record?
create Sequence S_SEG_EXE;
2
You can use the ALTER SEQUENCE
:
ALTER SEQUENCE S_SEG_EXE INCREMENT BY 100;
In the above example, the current value of the Quence increased by 100. The value may also be negative if you want to reduce the value.
Browser other questions tagged oracle
You are not signed in. Login or sign up in order to post.
but what syntax I can use in calling the value 100 if I don’t know what the current value
– Andersson OS
Don’t know how to get the value of a quence?
SELECT S_SEG_EXE.NEXTVAL FROM DUAL
– Ricardo Pontual
would that be the case? ALTER SEQUENCE S_SEG_EXE INCREMENT BY SELECT S_SEG_EXE.NEXTVAL FROM DUAL
– Andersson OS
NEXTVAL
does not bring the next value? To get the current value, I think it is best to useCURRVAL
: https://docs.oracle.com/cd/B28359_01/server.111/b28310/views002.htm#i1007824– hkotsubo
If you create it new, you can set the initial value with
START WITH 0
if you want to start at zero. Now to switch to the value you want, use thealter sequence
– Ricardo Pontual
Yes, @hkotsubo,
CURRVAL
would be better:SELECT S_SEG_EXE.CURRVALFROM DUAL
– Ricardo Pontual