Oracle设置序列方法

create sequence SEQ_LoanApplicantGuarantee
minvalue 1        
nomaxvalue        
start with 1      
increment by 1    
nocycle           
nocache; 

CREATE OR REPLACE TRIGGER TRI_LoanApplicantGuarantee
BEFORE INSERT ON LoanApplicantGuarantee FOR EACH ROW WHEN (new.GuaranteeID is null)
begin
select SEQ_LoanApplicantGuarantee.nextval into:new.GuaranteeID from dual;
end;  

以上SQL成功创办了班并因而Trigger将该和表绑定在了共

相关文章