◆ 获取sequence下一个值
select sequence.nextval from dual;
◆ sequence视图:
ALL_SEQUENCES
视图含义:
ALL_SEQUENCES describes all sequences accessible to the current user.
相关视图:
1、DBA_SEQUENCES describes all sequences in the database.
2、USER_SEQUENCES describes all sequences owned by the current user. This view does not display the SEQUENCE_OWNER column.
字段信息:
| Column | Datatype | NULL | Description |
|---|---|---|---|
| SEQUENCE_OWNER | VARCHAR2(30) | NOT NULL | Name of the owner of the sequence |
| SEQUENCE_NAME | VARCHAR2(30) | NOT NULL | Sequence name |
| MIN_VALUE | NUMBER | Minimum value of the sequence | |
| MAX_VALUE | NUMBER | Maximum value of the sequence | |
| INCREMENT_BY | NUMBER | NOT NULL | Value by which sequence is incremented |
| CYCLE_FLAG | VARCHAR2(1) | Does sequence wrap around on reaching limit | |
| ORDER_FLAG | VARCHAR2(1) | Are sequence numbers generated in order | |
| CACHE_SIZE | NUMBER | NOT NULL | Number of sequence numbers to cache |
| LAST_NUMBER | NUMBER | NOT NULL | Last sequence number written to disk. If a sequence uses caching, the number written to disk is the last number placed in the sequence cache. This number is likely to be greater than the last sequence number that was used. |
本文介绍了Oracle数据库中sequence的使用,包括如何获取sequence的下一个值以及详细解析了sequence的相关视图,帮助读者理解sequence视图的含义和字段信息。
4132

被折叠的 条评论
为什么被折叠?



