标签:constrain htm primary span cache rom dem end sele
1 CREATE TABLE demo6 2 ( 3 id INT NOT NULL, 4 key1 VARCHAR2(40) NULL, 5 key2 VARCHAR2(40) NULL 6 );
1 alter table demo6 add constraint demo6_pk primary key (id);
1 create sequence demo6_id 2 minvalue 1 3 nomaxvalue 4 increment by 1 5 start with 1 6 nocache;
1 create or replace trigger demo6_tg_insertId 2 before insert on demo6 for each row 3 begin 4 select demo6_id.Nextval into:new.id from dual; 5 end;
1 insert into demo6 (key1, key2) 2 values (‘key1‘, ‘key2‘); 3 insert into demo6 (key1, key2) 4 values (‘key11‘, ‘key22‘);
1 select * from demo6;
参考文章:http://www.cnblogs.com/dshore123/p/8267240.html
标签:constrain htm primary span cache rom dem end sele
原文地址:https://www.cnblogs.com/xiaostudy/p/10062491.html