Oracle9i中添加自增触发器

CREATE OR REPLACE TRIGGER [trigger_name]
BEFORE insert ON [table_name]
FOR EACH ROW
declare next_auto_no number;
begin
select [Sequence_name].nextval
into next_auto_no
from dual;
:new.[column_name]:=next_auto_no;
end;

你可能感兴趣的:(oracle)