当前位置:网站首页>ORACLE CREATE SEQUENCE,ALTER SEQUENCE,DROP SEQUENCE

ORACLE CREATE SEQUENCE,ALTER SEQUENCE,DROP SEQUENCE

2022-07-05 07:12:00 Just as young

Preface


I saw it in the process of getting familiar with the project today oracle Create a sequence of sql Code , So let's learn how to create a sequence 、 Modification and deletion .

CREATE SEQUENCE


The creation example is as follows :

CREATE SEQUENCE customers_seq
 START WITH     1000 --  from 1000 Start 
 MAXVALUE       9999 --  Maximum 
 INCREMENT BY   1    --  Number of intervals 
 CACHE          100  --  Number of caches 
 NOCYCLE;            --  Do not cycle after reaching the maximum 

ALTER SEQUENCE


An example of modification is as follows :

ALTER SEQUENCE customers_seq 
   MAXVALUE 1500; --  The maximum value is modified to 1500
ALTER SEQUENCE customers_seq 
   CACHE 5; --  The number of caches is modified to 5

DROP SEQUENCE


Examples of deletion are as follows :

DROP SEQUENCE oe.customers_seq; --  Delete sequence 

Reference link :Oracle Database Release 21.

原网站

版权声明
本文为[Just as young]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140559380079.html