insert into his_xd(areacode,patient_id,patient_source,oper_dtime)values('610724PDY000036', '202107260032', '门诊' ,to_date('2021-7-28','yyyy-mm-dd'));
commit
select * from HIS_XD t
CREATE sequence PATIENTS_ID --# STAFFS_ID序列名称
START WITH 1--# 开始值1
INCREMENT BY 1--# 递增1
nomaxvalue --# 不设置最大值
nocycle -- # 一直累加,不循环
nocache;--# 没有缓存
CREATE TRIGGER PATIENTS_TRIGGER --# STAFFS_TRIGGER触发器名称
before INSERT ON HIS_XD FOR each ROW WHEN (new.id IS NULL)
BEGIN
SELECT PATIENTS_ID.nextval into:New.ID from dual;
END;