Oracle触发器
–今天我们根据学到的东西实现一个id列自动增长的触发器
–首先我们需要建个表,主键id,name不为空
create table student(
id number primary key,
name varchar2(50) not null
)
–查一下看看
select * from student
–要实现id列自动增长,我们需要一个序列来生成连续的整数数据对象,2020年,我们就从2020开始
create sequence seq_student_id
start with 2020 --从2020开始
increment by 1