//Oracle 中给主键设置自增长,先设序列,在设置触发器
Create table BigCustemer1(
ID number(10), cus_name varchar2(20),
contacts varchar2(20),
phone varchar2(20) ,
email varchar2(30),
address varchar2(50),
notes varchar2(70)
);
create sequence bigcus_seq
increment by 1
start with 1
nomaxvalue
nominvalue
nocache
create or replace trigger BigCustemer1
before insert on BigCustemer1
for each row
begin
select BIGCUS_SEQ .nextval into :new.id from dual;
end;