1.序列的语法形式 create sequence 序列名 increment by n start with n maxvalue n | nomaxvalue minvalue n | nominvalue cycle | nocycle cache n | nocache 序列以(start with n)为第一个序列的值,序列各值之间的间隔为(increment by n),序列的最大值为(maxvalue n),序列的最小值为(minvalue n)cycle表示如果序列的值大于最大值
This queston came up on the Oracle newsgroup a few days ago: 这个问题在Oracle的新闻中心被提出了一段时间: I have a table (call it policy) with three columns a, b and c. The table has two rows, with column c having value zero for both rows. I run the following query 有个表
select t.*, t.rowid from tbl_type t order by t.id desc Select SEQ_TBL_TYPE_ID.NextVal From Dual; ; ; Select SEQ_TBL_TYPE_ID.currVal From Dual; DROP SEQUENCE SEQ_TBL_TYPE_ID; CREATE SEQUENCE SEQ_TBL_TYPE_ID; Oracle中创建.修改.删除序列 ORACLE没有象SQL SERVER中一样的自增
oracle序列创建以后,如果想重置序列从 0 开始,逐渐递增1,可以采用如下存储过程: create or replace procedure reset_seq( p_seq_name in varchar2 ) is l_val number; begin execute immediate 'select ' || p_seq_name || '.nextval from dual' INTO l_val; execute immediate 'alter sequence ' || p