Oracle设置体系方法

上述SQL成功开创了连串并用Trigger将其与表绑定在了伙同

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;  

相关文章