CREATE SEQUENCE HXID
INCREMENT BY 1
START WITH 1
MAXVALUE 9999999
NOCYCLE
//以上为建立序列
create or replace trigger TriggerID
before insert on GAS_INFO_HX
for each row
begin
select HXID.nextval into:new.ID from sys.dual;
end;
//以上为建立触发器
//插入一条数据的实例
INSERT INTO GAS_INFO_HX(CODE,STATUS,REC_TIME,DESCRIPTION) values ('888888',0,to_date('2009-02-08 13:12:12','yyyy-mm-dd hh24:mi:ss'),'正常')";