auto-increment 要用“序列”产生,oracle,没有auto-increment,在触发器里面使用“序列”处理

解决方案 »

  1.   

    最簡單的做法是使用erwin這樣的工具。
      

  2.   

    text对应long 自动序列要专门建1个再调用
    脚本1:建序列
    create sequence myid
        increment by 1
        start with 1
        nomaxvalue
        nocycle
        cache 10;
    脚本2:建表
    create table chatroom(
      nick char(20),
      sex char(10),
      color char(10),
      time char(30),
      note long,
      id integer,
      constraint pk primary key(id));
    举例使用Insert表时:
    insert into chatroom values(2,3,4,5,6,myid.nextval); -- myid.nextval就是取序列
    可以给分了