使用oracle触发器与序列产生业务单号
--第一步:建表 create table student( stuid varchar2(20),stuname varchar2(50),stusex varchar2(6)) -----添加主键--alter table student add constraint stu_pk primary key(stuid) --第二步:建序列 create sequence stu_seq --第三步:建触发器 CREATE OR REPLACE TRIGGER stu_tri1 BEFORE INSERT ON student FOR EACH ROW BEGIN SELECT 'S'|| to_char(SYSDATE,'yyyymmdd')||stu_seq.NEXTVAL INTO :NEW.stuid FROM dual; END; --创建触发器 create or replace trigger tri_user before insert on use