oracle sequence語法
SQL> create sequence seq_1 start with 1 increment by 1 nomaxvalue;
Sequence created.
SQL> alter sequence seq_1 cache 1000;
Sequence altered.
SQL> alter sequence seq_1 order;
Sequence altered.
SQL> desc user_sequences;
Name Null? Type
----------------------------------------- -------- ----------------------------
SEQUENCE_NAME NOT NULL VARCHAR2(30)
MIN_VALUE NUMBER
MAX_VALUE NUMBER
INCREMENT_BY NOT NULL NUMBER
CYCLE_FLAG VARCHAR2(1)
ORDER_FLAG VARCHAR2(1)
CACHE_SIZE NOT NULL NUMBER
LAST_NUMBER NOT NULL NUMBER
SQL> select sequence_name,min_value,max_value,increment_by,cycle_flag,last_number from user_sequences;
SEQUENCE_NAME MIN_VALUE MAX_VALUE INCREMENT_BY C LAST_NUMBER
------------------------------ ---------- ---------- ------------ - -----------
SEQ_1 1 1.0000E+27 1 N 1
SQL> alter sequence seq_1 cycle;
Sequence altered.
SQL> select sequence_name,min_value,max_value,increment_by,cycle_flag,last_number from user_sequences;
SEQUENCE_NAME MIN_VALUE MAX_VALUE INCREMENT_BY C LAST_NUMBER
------------------------------ ---------- ---------- ------------ - -----------
SEQ_1 1 1.0000E+27 1 Y 1
SQL> select seq_1.currval from dual;
select seq_1.currval from dual
*
ERROR at line 1:
ORA-08002: sequence SEQ_1.CURRVAL is not yet defined in this session
SQL> select seq_1.nextval from dual;
NEXTVAL
----------
1
SQL> select seq_1.currval from dual;
CURRVAL
----------
1
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-666443/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE SEQUENCEOracle
- ORACLE SEQUENCE用法Oracle
- Oracle - Sequence序列Oracle
- Oracle Sequence NocacheOracle
- Oracle序列sequenceOracle
- Oracle之Sequence(序列)Oracle
- Oracle Sequence Audses$研究Oracle
- oracle sequence 試用Oracle
- Oracle With 語法 示例Oracle
- oracle partition by 語法Oracle
- oracle的scn及sequenceOracle
- Oracle中Sequence的使用Oracle
- Oracle Merge語法Oracle
- AliSQL20171010版本釋出Sequence相容PostgreSQL/Oracle語法和升級TLSv1.2SQLOracleTLS
- Oracle sql with 語句語法與例子OracleSQL
- oracle中sequence使用的限制Oracle
- Oracle merge into delete語法Oracledelete
- 【轉載】oracle更新語法Oracle
- [SQL] Oracle基礎語法SQLOracle
- 建立Oracle包的語法Oracle
- Oracle常用sql語法集合OracleSQL
- ORACLE的基本語法(轉)Oracle
- Oracle物化檢視語法Oracle
- ORACLE UPDATE 語句語法與效能分析Oracle
- sequence to sequence模型模型
- Oracle -- 批次更新sequence的儲存Oracle
- Oracle -- 批量更新sequence的儲存Oracle
- ORACLE SEQUENCE的簡單介紹Oracle
- Oracle Sequence Cache 引數說明Oracle
- Oracle中sequence cache的測試Oracle
- Oracle中sequence的使用方法Oracle
- 不同於Oracle:SEQUENCE的區別Oracle
- Oracle 10g基本語法Oracle 10g
- ORACLE的基本語法集錦Oracle
- Keras版Sequence2Sequence對對聯實戰——自然語言處理技術Keras自然語言處理
- Oracle儲存過程基本語法Oracle儲存過程
- Oracle多表關聯更新的語法Oracle
- oracle之merge語法(轉載)Oracle