create sequence dept_deptid_seq
increment by 10
start with 120
maxvalue 9999
nocache
nocycle;
results
create sequence succeeded.
===> SQL Queries: Using A Sequence
- NEXTVAL [nextvalue]
- CURRVAL[currentvalue]
- NEXTVAL must be issued first before CURRVAL has value
values (dept_deptid_seq.NEXTVAL,'Support',2500);
select dept_deptid_seq.CURRVAL
from dual;
===> SQL Queries: Alter a Sequence
alter sequence dept_deptid_seq
increment by 20
maxvalue 999999
nocache
nocycle
Rules on modifying the sequence:
- Must have the privilege to Alter
- Only future sequence nos are affected
- To restart the sequence no, the sequence must be dropped and recreated
Results :
alter sequence dept_deptid_seq succeeded.
===> SQL Queries: Removing a Sequence
drop sequence dept_deptid_seq;
Results
drop sequence dept_deptid_seq succeeded.
No comments:
Post a Comment