标签:logs 添加 创建序列 har begin tar mbr ext sele
1、建立表
1 create table user 2 (3 4 id number(6) not null, 5 6 name varchar2(30) not null primary key 7 8 )
2、建立序列SEQUENCE
代码如下:
create sequence user_seq increment by 1 start with 1 minvalue 1 maxvalue 9999999999999 nocache order;
1 create or replace trigger user_trigger 2 3 before insert on user 4 for each row 5 begin 6 select user_seq.nextval into:new.id from sys.dual ; 7 end; 8
1 insert into itcastuser(name) values(‘aa‘); 2 commit; 3 4 insert into itcastuser(name) values(‘bb‘); 5 6 commit;
标签:logs 添加 创建序列 har begin tar mbr ext sele
原文地址:http://www.cnblogs.com/anzhi/p/7568276.html