有一个表aline,主键为objectid
create sequence SEQ_Userinf start with 1 increment by 1
nomaxvalue
nominvalue
nocache;
CREATE OR REPLACE TRIGGER tg_test
BEFORE INSERT ON aline
FOR EACH ROW WHEN (new.objectid is null)
begin
select SEQ_Userinf.nextval into:new.objectid from dual;
end;