标签:div nap pre end code sql can logs 一起
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将其与表绑定在了一起
标签:div nap pre end code sql can logs 一起
原文地址:http://www.cnblogs.com/Ericzya/p/7793337.html