sequence为表中的行动态的产生序列号。它是一个共享对象。典型用途是产生主键值。它独立于表存储。
 CREATE SEQUENCE [schema.]sequence
   [ INCREMENT BY integer
   | START WITH integer
   | {MAXVALUE integer | NOMAXVALUE}
   | {MINVALUE integer | NOMINVALUE}
   | {CYCLE | NOCYCLE}
   | {CACHE integer | NOCACHE}
   | {ORDER | NOORDER} ] ...
然后就可以通过你写的语句 insert into person values(序列名.nextval,'morebest'); 这样子来使用了。

解决方案 »

  1.   

    当然可以了。
    实际上序列和表没有关系的,他们是独立的数据库对象,表只是去取序列的值而已。SQL> create table person(
      2  ID number not null,
      3   name varchar2(10));表已创建。SQL> create sequence id;序列已创建。SQL> insert into person values(id.nextval,'John');已创建 1 行。SQL> select * from person;        ID NAME
    ---------- ----------
             1 John
      

  2.   

    楼上已说了,序列是单独的oracle内部存储对象,不能用于创建的关键字,这一点上不同于ms
    一般做法:
    1,触发器
    2,序列