Oracle sequence create sequence

Sequence SEQJD the Create 
MINVALUE 1 
MAXVALUE 99999999 
Start with 1 
INCREMENT by 1 
nocache 
the Order; 

built solution code for the hair: 

the Create or the replace the Trigger tri_test_id 
  the before the Test --S_Depart INSERT ON table name 
  for the each Row 
DECLARE 
  nextid Number The; 
the begin 
  IF: new new. id iS NULL or: new.id = 0 THEN --DepartId name of a column 
    select SEQ_ID.nextval --SEQ_ID It just created 
    INTO nextid 
    from sys.dual; 
    : new.id: = nextid; 
  End IF; 
End tri_test_id;

  

Guess you like

Origin www.cnblogs.com/lsb123/p/11249330.html