5
ad es. Ho una tabella:Come aggiungere un campo autoincrement per una tabella esistente e popolarlo con i numeri seriali per le righe?
create table test (testdata varchar2(255));
poi ho bisogno di un campo autoincrement:
alter table test add id numeric(10);
create sequence test_seq
start with 1
increment by 1
nomaxvalue;
create trigger test_trigger
before insert on test
for each row
begin
select test_seq.nextval into :new.id from dual;
end;
cosa devo fare dopo per riempire i campi già esistenti con relativi numeri di serie "id"?
Quindi è sempre 'TABLE_NAME_seq.nextval'? – Xonatron