oracle设置主键自动增长

摘要: 一.建立序列:create sequence 序列名 minvalue 1 maxvalue 999999999999999999999999999 start with 21 increment by 1 cache 20 order;二.建立触发器:CREATE OR REPLACE TRIGGER "触发器名" BEFORE INSERT ON 表名 FOR EACH ROW declare next_checkup_no number; begin select 序列名.nextval into:new.自动增长列 from dual; end; 阅读全文
posted @ 2012-02-08 09:51 那么简单 阅读(177) 评论(0) 推荐(0)