当前位置:   article > 正文

Oracle设置序列方法

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将其与表绑定在了一起

转载于:https://www.cnblogs.com/Ericzya/p/7793337.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/816670
推荐阅读
相关标签
  

闽ICP备14008679号