Oracle–序列相关知识

  • A+
所属分类:Oracle

Oracle--序列相关知识

1.创建序列

  CREATE SEQUENCE DEPT_DEPTID_SEQ  
  INCREMENT BY 10  
  START WITH 280  
  MAXVALUE 9990  
  NOCYCLE  
  NOCACHE;

2.使用序列

  INSERT INTO DEPARTMENTS  
  VALUES(DEPT_DEPTID_SEQ.NEXTVAL,'DEVELOPMENT',103,1700);  

3.修改序列

  ALTER SEQUENCE DEPT_DEPTID_SEQ  
  INCREMENT BY 20  
  CACHE 10;  

4.删除序列

  DROP SEQUENCE DEPT_DEPTID_SEQ;  
钰玺

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: