drop table book;
--创建表
create table book(
bookId varchar2() primary key,
name varchar2()
);
--创建序列
create sequence book_seq start with increment by ; --创建触发器
create or replace trigger book_trigger
before insert on book
for each row
begin
select book_seq.nextval into :new.bookId from dual;
end ;
--添加数据
insert into book(name) values ('cc');
insert into book(name) values ('dd'); commit; 查询数据:select * from book; 查询
select * from user_objects ubs where ubs.OBJECT_TYPE='SEQUENCE'; 
05-11 09:36