oracle自增列的问题

it2025-10-01  8

1 --创建表 2 create table test 3 ( 4 id number primary key, 5 name varchar2 not null 6 ); 7 --创建序列 8 create sequence test_seq 9 start with 1 increment by 1;10 11 --创建触发器12 create or replace trigger tri_test_zz13 before insert on test14 for each row15 begin16 select test_seq.nextval into :new.id from dual;17 end;

转载于:https://www.cnblogs.com/vida/archive/2012/02/29/2373061.html

最新回复(0)