oracle 数列,触发器(自动 ID 加1)

Create Sequence Sequence_Name //建序列
Increment By 1   //增加为1
Start With 1     //开始为1
Maxvalue 99999999 //最大
cache 20

Create Trigger Trigger_Name //创建触发器
Before Insert On Table_Name //条件
For Each Row                //
Begin
 select Sequence_Name.nextval into :new.ID from dual;  //ID加1
end;

你可能感兴趣的:(oracle,cache)