序列操作

创建序列:
create sequence <sequence_name>
[start with <start_value>]
[increment by <increment_value>]
[maxvalue <max_value>|nomaxvalue]
[minvalue <min_value>|nominvalue]
[cycle|nocycle]
[cache <value>|nochache]
[order|noorder]

 

修改序列:
alter sequence [user_name.]<sequence_name>
increment by <increment_value>]
[maxvalue <max_value>|nomaxvalue]
[minvalue <min_value>|nominvalue]
[cache <value>|nochache]
[order|noorder]

 

删除序列:
drop sequence [user_name.]<sequence_name>;

 

在oracle中访问序列:

select sequence_name.nextval from dual;//新生成的序列值

select sequence_name.currval from dual;//访问当前的序列值(即最后生成的序列值)

你可能感兴趣的:(序列)